only render 1 sample per event loop

master
Fabien Freling 2021-04-27 09:05:46 +02:00
parent 80fed125b4
commit a3df9a7707
1 changed files with 29 additions and 29 deletions

View File

@ -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);
}
}
}