From 793c86720cefa2698380ad75d65c307fe552e613 Mon Sep 17 00:00:00 2001 From: Fierelier Date: Tue, 13 Jun 2023 06:09:56 +0200 Subject: [PATCH] Add engine_window_texture_get implementation for lua --- src/lua_manual.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lua_manual.c b/src/lua_manual.c index c321970..8e480e0 100644 --- a/src/lua_manual.c +++ b/src/lua_manual.c @@ -30,9 +30,17 @@ int engine_luaf_texture_color_get(lua_State *L) { 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() { lua_pushcfunction(engine_lua_state,engine_luaf_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_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"); }