summaryrefslogtreecommitdiff
path: root/demo/basic/main.lua
blob: b7899a62e03b0ab98147f4a19342eeaf10c4fcb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
local glfw = honey.glfw
local gl = honey.gl

local err = glfw.Init()
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:", glfw.monitor_NULL, glfw.window_NULL)
glfw.SetJoystickCallback(function(jid, event) print(jid, event) end)

glfw.MakeContextCurrent(window)
gl.InitGlad()
while (glfw.WindowShouldClose(window) == glfw.FALSE) do
	honey.gl.Clear(honey.gl.COLOR_BUFFER_BIT)
	glfw.SwapBuffers(window)
	glfw.PollEvents()
end

glfw.Terminate()