Add engine_window_texture_get implementation for lua

This commit is contained in:
Fierelier 2023-06-13 06:09:56 +02:00
parent 9135abefb8
commit 793c86720c

View File

@ -30,9 +30,17 @@ int engine_luaf_texture_color_get(lua_State *L) {
return 4; return 4;
} }
int engine_luaf_window_texture_get(lua_State *L) {
struct ENGINE_WINDOW * window = lua_touserdata(L,1);
lua_pushlightuserdata(L,window->texture);
return 1;
}
void engine_lua_init_manual() { void engine_lua_init_manual() {
lua_pushcfunction(engine_lua_state,engine_luaf_lua_event_get_data); lua_pushcfunction(engine_lua_state,engine_luaf_lua_event_get_data);
lua_setglobal (engine_lua_state,"engine_lua_event_get_data"); lua_setglobal (engine_lua_state,"engine_lua_event_get_data");
lua_pushcfunction(engine_lua_state,engine_luaf_texture_color_get); lua_pushcfunction(engine_lua_state,engine_luaf_texture_color_get);
lua_setglobal (engine_lua_state,"engine_texture_color_get"); lua_setglobal (engine_lua_state,"engine_texture_color_get");
lua_pushcfunction(engine_lua_state,engine_luaf_window_texture_get);
lua_setglobal (engine_lua_state,"engine_window_texture_get");
} }