From b2c0dd12d2a39e74f8e6d63bffec073ef0871ea7 Mon Sep 17 00:00:00 2001 From: sanine Date: Mon, 22 Aug 2022 12:39:51 -0500 Subject: add uniforms --- src/gl/window.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/gl/window.c') diff --git a/src/gl/window.c b/src/gl/window.c index 075bd6c..1b8c4bb 100644 --- a/src/gl/window.c +++ b/src/gl/window.c @@ -27,6 +27,8 @@ int window_should_close(lua_State *L); int window_poll_events(lua_State *L); int window_swap_buffers(lua_State *L); int window_set_framebuffer_size_callback(lua_State *L); +int window_get_time(lua_State *L); + void setup_window(lua_State *L, int honey_index) @@ -50,6 +52,7 @@ void setup_window(lua_State *L, int honey_index) hs_str_cfunc("pollEvents", window_poll_events), hs_str_cfunc("swapBuffers", window_swap_buffers), hs_str_cfunc("setFramebufferSizeCallback", window_set_framebuffer_size_callback), + hs_str_cfunc("getTime", window_get_time), hs_str_tbl("hintType", hint_types), hs_str_tbl("profileType", profile_types), @@ -158,3 +161,10 @@ int window_set_framebuffer_size_callback(lua_State *L) wdata->framebuffer_size_callback = hs_rstore(L); return 0; } + + +int window_get_time(lua_State *L) +{ + lua_pushnumber(L, glfwGetTime()); + return 1; +} -- cgit v1.2.1