[Solved] Adding a new module to Love, help!
Posted: Sat Jan 14, 2017 12:12 pm
Hi all,
I'm adding a new C++ module to love, I've downloaded the sources and compiled the project, once I got that working I added my own module to love, but when building it, it doesn't seem to have my love.myModule
Things I've done so far:
I'm pretty sure I'm missing something as love.myModule is not inside love._modules when debugging my game with the love.exe I'm building.
Can someone point me in the right direction?
Thanks!
I'm adding a new C++ module to love, I've downloaded the sources and compiled the project, once I got that working I added my own module to love, but when building it, it doesn't seem to have my love.myModule
Things I've done so far:
- - I copied how other modules are registered, so my module has an extern "C" int luaopen_love_myModule(lua_State *L)
- Inside that function I end up calling return luax_register_module(L, w);
- I have defined: #define instance() (Module::getInstance<MyModule>(Module::M_MYMODULE))
- I'm adding my module in static const luaL_Reg modules[]
- When int luaopen_love(lua_State *L) gets called, I can see myModule is being preloaded in the for loop for (int i = 0; modules.name != nullptr; i++)
- To make sure I'm actually making changes to the source correctly, I changed the codename value to "Test" and when launching love.exe after building, it prints the value "Test" rather than "Super Toast"
I'm pretty sure I'm missing something as love.myModule is not inside love._modules when debugging my game with the love.exe I'm building.
Can someone point me in the right direction?
Thanks!