How do I control the iterate rate?

Maybe I missed it in the docs. I want to draw only when 1) after processing an event and it’s an event that changes the frame 2) After X ms when I need to draw some animation. The animation take place every 1second since window focus

Is this the best way to implement this? At the start of SDL_AppIterate I check if I need to draw (either requested by event or if its within a few ms of the animation frame,) if not I sleep for a few milliseconds (such as 4ms) then return without rendering so the events can execute?

I also do not want events happening concurrently or during SDL_AppIterate so I will need locks?

1 Like