only render 1 sample per event loop
This commit is contained in:
		
							parent
							
								
									80fed125b4
								
							
						
					
					
						commit
						a3df9a7707
					
				
					 1 changed files with 29 additions and 29 deletions
				
			
		| 
						 | 
				
			
			@ -128,9 +128,9 @@ pub fn main() anyerror!void {
 | 
			
		|||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (k < samplesPerPixel) {
 | 
			
		||||
 | 
			
		||||
            // Render
 | 
			
		||||
        {
 | 
			
		||||
            while (k < samplesPerPixel) {
 | 
			
		||||
            _ = sdl.c.SDL_LockSurface(surface);
 | 
			
		||||
 | 
			
		||||
            var j: usize = 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -160,11 +160,11 @@ pub fn main() anyerror!void {
 | 
			
		|||
            sdl.c.SDL_UnlockSurface(surface);
 | 
			
		||||
            _ = sdl.c.SDL_UpdateWindowSurface(window);
 | 
			
		||||
            k += 1;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (k >= samplesPerPixel) {
 | 
			
		||||
        } else {
 | 
			
		||||
 | 
			
		||||
            sdl.c.SDL_Delay(1000 / fps);
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue