From a54657e7be7478c4206002b8eae8e1b61335808d Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Sun, 26 Jan 2025 18:34:34 +0300 Subject: [PATCH] twn_loop.c: limit minimum amount of delay --- src/twn_loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/twn_loop.c b/src/twn_loop.c index 3ed5736..807f1b4 100644 --- a/src/twn_loop.c +++ b/src/twn_loop.c @@ -252,7 +252,7 @@ static void main_loop(void) { /* which for now is broken as glBufferData with NULL is used all over right after render */ if (frames != 0) render(); - else + else if (ctx.desired_frametime - ctx.frame_accumulator > 1000000) /* don't waste clock cycles on useless work */ /* TODO: make it adjustable from config */ SDL_Delay((uint32_t)(ctx.desired_frametime - ctx.frame_accumulator) / 1250000);