From 970768288dd0dbb251783b4e35ee9f32899222ff Mon Sep 17 00:00:00 2001 From: Larpon Date: Sat, 25 Sep 2021 14:06:56 +0200 Subject: [PATCH] gg: expose sapp_desc.swap_interval via gg.Config (#11975) --- vlib/gg/gg.c.v | 1 + vlib/gg/gg.v | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/vlib/gg/gg.c.v b/vlib/gg/gg.c.v index c9869d676f..af6f8933ad 100644 --- a/vlib/gg/gg.c.v +++ b/vlib/gg/gg.c.v @@ -198,6 +198,7 @@ pub fn new_context(cfg Config) &Context { enable_dragndrop: cfg.enable_dragndrop max_dropped_files: cfg.max_dropped_files max_dropped_file_path_length: cfg.max_dropped_file_path_length + swap_interval: cfg.swap_interval } g.window = window return g diff --git a/vlib/gg/gg.v b/vlib/gg/gg.v index d6c466370b..f0ea427176 100644 --- a/vlib/gg/gg.v +++ b/vlib/gg/gg.v @@ -63,9 +63,10 @@ pub: resized_fn FNEvent = voidptr(0) scroll_fn FNEvent = voidptr(0) // wait_events bool // set this to true for UIs, to save power - fullscreen bool - scale f32 = 1.0 - sample_count int + 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) // ved needs this // init_text bool font_path string