luaL_newlib is the way
This commit is contained in:
parent
e4bf16bd57
commit
890c0dd514
|
@ -25,8 +25,7 @@ bool loadapi_draw(lua_State *lua) {
|
||||||
{ "circle", api_draw_circle },
|
{ "circle", api_draw_circle },
|
||||||
{ "ring", api_draw_ring },
|
{ "ring", api_draw_ring },
|
||||||
};
|
};
|
||||||
lua_newtable(lua);
|
luaL_newlib(lua, api_draw);
|
||||||
luaL_setfuncs(lua, api_draw, 0);
|
|
||||||
lua_setglobal(lua, "Draw");
|
lua_setglobal(lua, "Draw");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue