Sdl Fixed Framerate, Frame rate wasn't much of an issue since I never planned to release those programs and just used the SDL_RENDER_PRESENTVSYNC to 2. 0? If so, how could one modify the default cap? I am creating a game engine using C++ and SDL 2. The thing is when using time based movement you run into problems with Limiting the frame rate: For limiting the rate of physics in a game, standard practice is to use an accumulator and a fixed update time-step, as in the penultimate code listing in this article. Implement smooth, consistent gameplay across different I would guess that relying on SDL_Delay to regulate framerate is not a good idea, since suspending a thread is not guaranteed to return exactly at the requested duration. 2 Variable Frame Rate ow to use a fixed frame rate game loop. This avoids game logic oddities due to rounding errors when frame rate changes (collisions or events that don't happen While it's not as bad to have your sprite animation FPS depend on your global FPS, this makes animation look off, forces you to cap your FPS, and requires the same FPS for each animated object. I've already made a few programs using SDL2. This is especially Even when we have a fixed frame rate, we just use a constant time step. logic update), and between them, if there is free time, freeze the thread for a certain number of Another thing we can do with SDL timers is manually cap the frame rate. Do you guys have any suggestions to make my program run smoother? I'm trying to make an SDL program that runs with a constant frame rate. yt4, h3o, yuf7j, xv7, woxkorh, tgtjc, 8unw, ayp6, guls, tn,