From c2329b4c8258baa9429c77566c9def97d00e96d7 Mon Sep 17 00:00:00 2001 From: sanine Date: Fri, 10 Mar 2023 02:33:42 -0600 Subject: demonstrate working glfw refactored bindings --- demo/basic/main.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'demo/basic') diff --git a/demo/basic/main.lua b/demo/basic/main.lua index 0950690..b7899a6 100644 --- a/demo/basic/main.lua +++ b/demo/basic/main.lua @@ -1,18 +1,21 @@ local glfw = honey.glfw +local gl = honey.gl local err = glfw.Init() -print(err, glfw.TRUE) if err ~= glfw.TRUE then local err, desc = glfw.GetError() error("failed to initialize glfw: " .. tostring(err)) end -local window = glfw.CreateWindow(640, 480, "Hello world c:", nil, nil) + +local window = glfw.CreateWindow(640, 480, "Hello world c:", glfw.monitor_NULL, glfw.window_NULL) +glfw.SetJoystickCallback(function(jid, event) print(jid, event) end) glfw.MakeContextCurrent(window) -while (glfw.WindowShouldClose(window) ~= glfw.FALSE) do - gl.Clear(gl.COLOR_BUFFER_BIT) - glfw.SwapBUffers(window) +gl.InitGlad() +while (glfw.WindowShouldClose(window) == glfw.FALSE) do + honey.gl.Clear(honey.gl.COLOR_BUFFER_BIT) + glfw.SwapBuffers(window) glfw.PollEvents() end -- cgit v1.2.1