From 1d0db4c46573299a2cb7c069b302857e0dc4f8e1 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sat, 27 Jan 2018 19:53:20 -0500 Subject: window: Display warning when vsync is not supported. A lot better than crashing, I'd say. :) Reported-By: Christopher Howard * chickadee/window.scm (open-window): Catch errors thrown by set-gl-swap-interval! and emit warning. --- chickadee/window.scm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/chickadee/window.scm b/chickadee/window.scm index 8d51fa1..7f138c1 100644 --- a/chickadee/window.scm +++ b/chickadee/window.scm @@ -58,7 +58,13 @@ #:fullscreen? fullscreen?)) (gl-context (sdl2:make-gl-context sdl-window)) (window (make-window sdl-window gl-context))) - (sdl2:set-gl-swap-interval! 'vsync) + ;; Some systems do not support setting the OpenGL swap interval. + (catch #t + (lambda () + (sdl2:set-gl-swap-interval! 'vsync)) + (lambda args + (display "warning: could not enable vsync\n" + (current-error-port)))) window)) (define (close-window! window) -- cgit v1.2.3