diff options
author | sanine <sanine.not@pm.me> | 2023-03-10 02:33:42 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-03-10 02:33:42 -0600 |
commit | c2329b4c8258baa9429c77566c9def97d00e96d7 (patch) | |
tree | 029da1a4a2c5ac7bd7714ee70f195378f5c68c8e /demo | |
parent | 51c7235d4e0a2df109dd5050328a0ad4a1878ae4 (diff) |
demonstrate working glfw refactored bindings
Diffstat (limited to 'demo')
-rw-r--r-- | demo/basic/main.lua | 13 |
1 files changed, 8 insertions, 5 deletions
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 |