twn_loop.c: limit minimum amount of delay
This commit is contained in:
		@@ -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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user