From 51c7235d4e0a2df109dd5050328a0ad4a1878ae4 Mon Sep 17 00:00:00 2001 From: sanine Date: Fri, 10 Mar 2023 02:05:18 -0600 Subject: refactor: move glfw functions into separate table --- demo/basic/main.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 demo/basic/main.lua (limited to 'demo/basic') 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() -- cgit v1.2.1