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:
rude
2009-09-02 21:18:13 +02:00
parent bea504af2b
commit 623e701549
22 changed files with 247 additions and 176 deletions
+10 -4
View File
@@ -72,7 +72,7 @@ namespace sdl
};
// List of constants.
static const LuaConstant constants[] = {
static const Constant constants[] = {
{ "event_keypressed", Event::EVENT_KEYDOWN },
{ "event_keyreleased", Event::EVENT_KEYUP },
{ "event_mousepressed", Event::EVENT_MOUSEBUTTONDOWN },
@@ -97,9 +97,15 @@ namespace sdl
}
}
luax_register_gc(L, instance);
return luax_register_module(L, functions, 0, constants, "event");
WrappedModule w;
w.module = instance;
w.name = "event";
w.flags = MODULE_T;
w.functions = functions;
w.types = 0;
w.constants = constants;
return luax_register_module(L, w);
}
} // sdl