diff options
| author | sanine-a <sanine.not@pm.me> | 2023-05-11 10:53:51 -0500 | 
|---|---|---|
| committer | sanine-a <sanine.not@pm.me> | 2023-05-11 10:53:51 -0500 | 
| commit | 997a16674dd88aa3ffc76e1d68b860278156689d (patch) | |
| tree | 70f147f40a06602081b00acacef8e22d02bb9d30 /honey/init.lua | |
| parent | 14195dac1eda9140192ca07003258715b8b0abd3 (diff) | |
limit framerate to 60 fpsrdbms-ecs
Diffstat (limited to 'honey/init.lua')
| -rw-r--r-- | honey/init.lua | 10 | 
1 files changed, 6 insertions, 4 deletions
| 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 | 
