luaL_newlib is the way

This commit is contained in:
Casey 2024-04-10 15:21:34 +03:00
parent e4bf16bd57
commit 890c0dd514
Signed by: hkc
GPG Key ID: F0F6CFE11CDB0960
1 changed files with 1 additions and 2 deletions

View File

@ -25,8 +25,7 @@ bool loadapi_draw(lua_State *lua) {
{ "circle", api_draw_circle },
{ "ring", api_draw_ring },
};
lua_newtable(lua);
luaL_setfuncs(lua, api_draw, 0);
luaL_newlib(lua, api_draw);
lua_setglobal(lua, "Draw");
return true;
}