aboutsummaryrefslogtreecommitdiffstats
path: root/examples/pugl_shader_demo.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2025-01-21 16:08:13 -0500
committerDavid Robillard <d@drobilla.net>2025-01-21 16:24:17 -0500
commitbf01b1e98f1759982e0ee012a3379507f3e72af7 (patch)
treefab71fa4abdb5efa3c9cae6dbf78d0e3bf5aabe6 /examples/pugl_shader_demo.c
parent90e05c940a4f99548d982b6976ba9aff8e6bdd8f (diff)
downloadpugl-bf01b1e98f1759982e0ee012a3379507f3e72af7.tar.gz
pugl-bf01b1e98f1759982e0ee012a3379507f3e72af7.tar.bz2
pugl-bf01b1e98f1759982e0ee012a3379507f3e72af7.zip
Fix pugl_shader_demo refresh rate on Windows
Diffstat (limited to 'examples/pugl_shader_demo.c')
-rw-r--r--examples/pugl_shader_demo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/pugl_shader_demo.c b/examples/pugl_shader_demo.c
index 9ba3da0..2cdcb6e 100644
--- a/examples/pugl_shader_demo.c
+++ b/examples/pugl_shader_demo.c
@@ -470,7 +470,7 @@ updateTimeout(const PuglTestApp* const app)
const double nextExposeTime = nextFrameEndTime - neededTime;
const double timeUntilNext = nextExposeTime - now;
- return timeUntilNext;
+ return fmax(0.0, (timeUntilNext * 0.9) - 0.001);
}
int
@@ -505,7 +505,7 @@ main(int argc, char** argv)
const double startTime = puglGetTime(app.world);
PuglFpsPrinter fpsPrinter = {startTime};
while (!app.quit) {
- puglUpdate(app.world, fmax(0.0, updateTimeout(&app)));
+ puglUpdate(app.world, updateTimeout(&app));
puglPrintFps(app.world, &fpsPrinter, &app.framesDrawn);
}