The C functions are to deal with wiiuse library, so I can use this feature in Love games.
So here is the code:
Code: Select all
#include "wiiuse.h"
#include "lua/lua.h"
#include "lua/lauxlib.h"
static int wiiInit(lua_State *L)
{
int x = lua_tointeger(L, 1);
printf("x = %d\n", x);
//wiimote ** wm = wiiuse_init(x);
//lua_pushinteger(L, wm);
return 1;
}
int luaopen_wiilib (lua_State *L) {
struct luaL_Reg driver[] = {
{"wiiInit", wiiInit},
{NULL, NULL}
};
luaL_openlib(L, "wiilib", driver, 0);
return 1;
}
Code: Select all
wiilib = require("wiilib")
wiilib.wiiInit(1, 2, 3)
Code: Select all
x = 0
What am I missing here? Any ideas, suggestions?
By the way the dll is compiled along with lua 5.2 and the wiiuse libraries.
Thanks <3