summaryrefslogtreecommitdiff
path: root/demo/basic
diff options
context:
space:
mode:
Diffstat (limited to 'demo/basic')
-rw-r--r--demo/basic/main.lua13
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