summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2016-08-11 22:49:03 -0400
committerDavid Thompson <dthompson2@worcester.edu>2016-08-11 22:49:03 -0400
commita06ff79a3276fb336fc00ff8c4c9ab1209f3441f (patch)
treece7500cc78febe458e5e52c7dce6e1213326cbf7
parentd4b3f37d73194fca4533af9cc2452bcace52ac68 (diff)
window: Tweak the responsibilities of init-window and open-window.
* sly/window.scm (init-window): Initialize SDL. (open-window): Don't call init-window and don't initialize SDL.
-rw-r--r--sly/window.scm4
1 files changed, 2 insertions, 2 deletions
diff --git a/sly/window.scm b/sly/window.scm
index 7b17276..f2f04cc 100644
--- a/sly/window.scm
+++ b/sly/window.scm
@@ -45,6 +45,7 @@
window-close-hook
init-window
+ open-window
swap-window))
(define-record-type <window>
@@ -92,6 +93,7 @@
(define %gl-context #f)
(define (init-window)
+ (sdl2:sdl-init)
(set! %sdl-window (sdl2:make-window #:opengl? #t #:show? #t))
(sdl2:set-gl-attribute! 'context-major-version 3)
(sdl2:set-gl-attribute! 'context-minor-version 2)
@@ -101,8 +103,6 @@
(sdl2:set-gl-swap-interval! 'vsync))
(define (open-window window)
- (sdl2:sdl-init)
- (init-window)
(let ((res (window-resolution window)))
(sdl2:set-window-title! %sdl-window (window-title window))
(sdl2:set-window-size! %sdl-window (list (vx res) (vy res)))