3 ms·
After I wrote this comment, I decided to have another look to see if this was fixed on Windows yet. It turns out it is. You can call DwmFlush() which deschedule
by abainbridge 8y ago
After I wrote this comment, I decided to have another look to see if this was fixed on Windows yet. It turns out it is. You can call DwmFlush() which deschedules your app until the Desktop Window Manager decides it is time to draw a new frame.
I might now try to recreate the classic Amiga Bezier lines screen saver.
- abainbridge 8y agoFurther update: On one machine I found that while DwmFlush() reliably keeps sync to the video rate (ie every time it returns is 1/60th of a second after the previous time), this wasn't sufficient to keep the video output stutter free. I tried many things to get rid of the stutters and gave up after an hour. My guess is the the compositor gives no guarantee that it will display every "frame" your app gives it, even if you give it exactly one per vsync. The next day my machine had rebooted itself (presumably to apply an update) and now the stutter is gone. That's the kind of thing that didn't happen on an Amiga :-)