summaryrefslogtreecommitdiff
path: root/demo/basic
diff options
context:
space:
mode:
Diffstat (limited to 'demo/basic')
-rw-r--r--demo/basic/main.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/demo/basic/main.lua b/demo/basic/main.lua
new file mode 100644
index 0000000..0950690
--- /dev/null
+++ b/demo/basic/main.lua
@@ -0,0 +1,19 @@
+local glfw = honey.glfw
+
+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)
+
+glfw.MakeContextCurrent(window)
+while (glfw.WindowShouldClose(window) ~= glfw.FALSE) do
+ gl.Clear(gl.COLOR_BUFFER_BIT)
+ glfw.SwapBUffers(window)
+ glfw.PollEvents()
+end
+
+glfw.Terminate()