feat: add vsync-priority frame pacing to video backends

Present now dispatches through a function pointer chosen at init and
re-chosen by two new runtime setters: real vsync if requested and the
driver grants it, else a manual sleep-based cap (auto-detects display
refresh rate, falls back to 60fps if that can't be queried), else
fully uncapped. skele_video_using_vsync() reports what was actually
granted; skele_video_set_vsync()/skele_video_set_max_fps() let a game
change either live without tearing down the renderer/GL context.
This commit is contained in:
2026-08-23 17:06:33 +02:00
parent ddaeafc14f
commit 55055a042d
5 changed files with 159 additions and 6 deletions
+2 -1
View File
@@ -30,7 +30,8 @@ int main(int argc, char *argv[])
video_cfg.render_height = SKELE_DEFAULT_RENDER_HEIGHT;
video_cfg.window_width = 0;
video_cfg.window_height = 0;
video_cfg.flags = 0;
video_cfg.max_fps = 0;
video_cfg.flags = SKELE_VIDEO_VSYNC;
if (skele_video_init(video_cfg) != SKELE_INIT_SUCCESS) {
skele_stk_teardown();