This should remove the last major bit of platform-specific code.
Had to reduce az_sleep_until() to only millisecond-resolution due to using SDL_Delay() (mildly annoyed SDL doesn't have a SDL_Nanodelay()) but I wasn't seeing any animation smoothness issues on Linux, macOS, or Windows from doing so.
Also slightly modified az_sleep_until() to return az_current_time_nanos() which has the nice side-effect of making the system converge to a delay-less state (no SDL_Delay() calls, only 'long' vsync'd SDL_GL_SwapWindow() calls) in 20-30 frames. Vsync-off also still works.
This should remove the last major bit of platform-specific code.
Had to reduce
az_sleep_until()
to only millisecond-resolution due to usingSDL_Delay()
(mildly annoyed SDL doesn't have aSDL_Nanodelay()
) but I wasn't seeing any animation smoothness issues on Linux, macOS, or Windows from doing so.Also slightly modified
az_sleep_until()
to returnaz_current_time_nanos()
which has the nice side-effect of making the system converge to a delay-less state (noSDL_Delay()
calls, only 'long' vsync'dSDL_GL_SwapWindow()
calls) in 20-30 frames. Vsync-off also still works.