From ef48092c9752fe3fdd358351f368c8c66da3638d Mon Sep 17 00:00:00 2001 From: sanine-a Date: Sat, 24 Oct 2020 22:51:10 -0500 Subject: add window resize callback functions --- demo/main.lua | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'demo') diff --git a/demo/main.lua b/demo/main.lua index 64ab0ae..e7f95c1 100644 --- a/demo/main.lua +++ b/demo/main.lua @@ -6,20 +6,15 @@ local a_func = function(action, data) honey.window.set_fullscreen(fullscreen) end -local b_func = function(action, data) - if (action == 0) then return end +local resize_func = function(width, height, data) local w, h = honey.window.get_size() - print(w, h) -end - -for k,v in pairs(honey.window) do - print(k, v) + print('resized!', w, h) end honey.window.set_title('honey engine demo') honey.input.bind_key(honey.input.key.a, a_func) -honey.input.bind_key(honey.input.key.b, b_func) +honey.window.resize_bind(resize_func) function honey.update(dt) end -- cgit v1.2.1