From 0c40641367b719800137f3d72706aba1b2020205 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 25 Mar 2026 16:42:26 +0300 Subject: [PATCH] gg: fix preferred swap interval ignored on some platforms (fixes #20681) --- vlib/gg/gg.c.v | 2 +- vlib/gg/gg.js.v | 2 +- vlib/sokol/sapp/sapp_structs.c.v | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vlib/gg/gg.c.v b/vlib/gg/gg.c.v index c793a1276..85f5ec3be 100644 --- a/vlib/gg/gg.c.v +++ b/vlib/gg/gg.c.v @@ -142,7 +142,7 @@ pub: fullscreen bool // set this to true, if you want your window to start in fullscreen mode (suitable for games/demos/screensavers) scale f32 = 1.0 sample_count int // bigger values usually have performance impact, but can produce smoother/antialiased lines, if you draw lines or polygons (2 is usually good enough) - swap_interval int = 1 // 1 = 60fps, 2 = 30fps etc. The preferred swap interval (ignored on some platforms) + swap_interval int = 1 // 1 = 60fps, 2 = 30fps etc. Honored on Windows, macOS, Linux, iOS, and HTML5; Android support is not implemented yet. // ved needs this // init_text bool font_path string diff --git a/vlib/gg/gg.js.v b/vlib/gg/gg.js.v index 2fbede710..459e6eee8 100644 --- a/vlib/gg/gg.js.v +++ b/vlib/gg/gg.js.v @@ -234,7 +234,7 @@ pub: fullscreen bool scale f32 = 1.0 sample_count int - swap_interval int = 1 // 1 = 60fps, 2 = 30fps etc. The preferred swap interval (ignored on some platforms) + swap_interval int = 1 // 1 = 60fps, 2 = 30fps etc. Ignored by the JS backend; frame pacing follows requestAnimationFrame. // ved needs this // init_text bool font_path string diff --git a/vlib/sokol/sapp/sapp_structs.c.v b/vlib/sokol/sapp/sapp_structs.c.v index 7255a53a7..7831ee74e 100644 --- a/vlib/sokol/sapp/sapp_structs.c.v +++ b/vlib/sokol/sapp/sapp_structs.c.v @@ -248,7 +248,7 @@ pub mut: width int // the preferred width of the window / canvas height int // the preferred height of the window / canvas sample_count int // MSAA sample count - swap_interval int // the preferred swap interval (ignored on some platforms) + swap_interval int // the preferred swap interval on Windows, macOS, Linux, iOS, and HTML5; Android support is not implemented yet high_dpi bool // whether the rendering canvas is full-resolution on HighDPI displays fullscreen bool // whether the window should be created in fullscreen mode alpha bool // whether the framebuffer should have an alpha channel (ignored on some platforms) -- 2.39.5