From 997a16674dd88aa3ffc76e1d68b860278156689d Mon Sep 17 00:00:00 2001 From: sanine-a Date: Thu, 11 May 2023 10:53:51 -0500 Subject: limit framerate to 60 fps --- honey/init.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'honey/init.lua') diff --git a/honey/init.lua b/honey/init.lua index d2f5279..887cf02 100644 --- a/honey/init.lua +++ b/honey/init.lua @@ -33,10 +33,12 @@ function loop(window, update) while not window:shouldClose() do local time = glfw.GetTime() local dt = time - prevTime - prevTime = time - update(dt) - window:swapBuffers() - glfw.PollEvents() + if dt > 1/60 then + prevTime = time + update(dt) + window:swapBuffers() + glfw.PollEvents() + end end end -- cgit v1.2.1