mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Modules now reside in Lua and are treated (almost) like normal objects.
Also added a way of getting a pointer to abstract module instances internally.
This commit is contained in:
@@ -99,7 +99,7 @@ namespace devil
|
||||
// Bind the image.
|
||||
ilBindImage(image);
|
||||
// Try to load the data.
|
||||
bool success = ilTexImage(width, height, 1, bpp, IL_RGBA, IL_UNSIGNED_BYTE, data);
|
||||
bool success = (ilTexImage(width, height, 1, bpp, IL_RGBA, IL_UNSIGNED_BYTE, data) == IL_TRUE);
|
||||
int err = ilGetError();
|
||||
if (err != IL_NO_ERROR){
|
||||
switch (err) {
|
||||
|
||||
@@ -92,9 +92,15 @@ namespace image
|
||||
}
|
||||
}
|
||||
|
||||
luax_register_gc(L, instance);
|
||||
|
||||
return luax_register_module(L, functions, types, 0, "image");
|
||||
WrappedModule w;
|
||||
w.module = instance;
|
||||
w.name = "image";
|
||||
w.flags = MODULE_IMAGE_T;
|
||||
w.functions = functions;
|
||||
w.types = types;
|
||||
w.constants = 0;
|
||||
|
||||
return luax_register_module(L, w);
|
||||
}
|
||||
|
||||
} // image
|
||||
|
||||
Reference in New Issue
Block a user