I want to run alternating events on every other frame (eg. ABABAB), and I'm not sure how to do it.
I can make something display every second tick (every second loop of the events), but that won't necessarily correspond to actual frames that the monitor displays. Depending on the FPS and other variables such as vsync, some ticks may get displayed more than once, while others may run but not have time to get displayed, meaning that my ABABAB may end up something like ABAABAABBA
Is there a way I can do this? Perhaps a way to test whether an event loop has made it to the screen?