summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2016-01-12 08:33:35 -0500
committerDavid Thompson <dthompson2@worcester.edu>2016-01-12 08:38:51 -0500
commit4820142ac1741e9137a832cf20f2e17f6912b5c3 (patch)
tree3d07bdcb360f58fd8bdf2e74a486632798e2ef88
parentcb66f98d0feef93b93a7da273a56ef46de539e5f (diff)
window: Configure various OpenGL parameters.
* sly/window.scm (init-window): Set OpenGL version to 3.2, explicitly set double buffering and vsync, and configure depth buffer size.
-rw-r--r--sly/window.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/sly/window.scm b/sly/window.scm
index fb7c69b..739bb71 100644
--- a/sly/window.scm
+++ b/sly/window.scm
@@ -93,7 +93,12 @@
(define (init-window)
(set! %sdl-window (sdl2:make-window #:opengl? #t #:show? #t))
- (set! %gl-context (sdl2:make-gl-context %sdl-window)))
+ (sdl2:set-gl-attribute! 'context-major-version 3)
+ (sdl2:set-gl-attribute! 'context-minor-version 2)
+ (sdl2:set-gl-attribute! 'double-buffer 1)
+ (sdl2:set-gl-attribute! 'depth-size 24)
+ (set! %gl-context (sdl2:make-gl-context %sdl-window))
+ (sdl2:set-gl-swap-interval! 'vsync))
(define (open-window window)
(let ((res (window-resolution window)))