diff options
author | David Thompson <dthompson2@worcester.edu> | 2018-01-27 19:53:20 -0500 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2018-01-27 20:49:07 -0500 |
commit | 1d0db4c46573299a2cb7c069b302857e0dc4f8e1 (patch) | |
tree | cc5d6c4dc6459822a252d028cc0dd12d6704452c | |
parent | 44815d406e6679f5f010c7c75f43f17016d822b9 (diff) |
window: Display warning when vsync is not supported.
A lot better than crashing, I'd say. :)
Reported-By: Christopher Howard <christopher.howard@qlfiles.net>
* chickadee/window.scm (open-window): Catch errors thrown by
set-gl-swap-interval! and emit warning.
-rw-r--r-- | chickadee/window.scm | 8 |
1 files changed, 7 insertions, 1 deletions
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) |