4 ms·
I've used this exact pattern before when designing a homegrown kiosk display renderer with an immediate mode GUI; and I think it is pretty common in games as we
by nemothekid 4y ago
I've used this exact pattern before when designing a homegrown kiosk display renderer with an immediate mode GUI; and I think it is pretty common in games as well (this is how Raylib's renderer works). You could push frames as fast possible, but you will chew up the CPU doing inefficient work and overload the hardware needlessly. If you have something like a physics engine you may also want to design a physics loop that runs every X milliseconds (again, if you let it run as fast as possible, the game world will be in super speed; there have been reports of bad developers who couple their render loop with the physics loop and once the framerate becomes uncapped, the game becomes unplayable).
- monocasa 4y agoBetter than that is a vsync event to wait on.
- bruce343434 4y agoWhat if you're developing an authoritative game server? There will be no vsync event.
- heavenlyblue 4y ago> again, if you let it run as fast as possible, the game world will be in super speed Not really, you can calculate how long had passed since the last physics recalculation and use that as a delta between frames.