summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-03-29 16:13:53 -0400
committerDavid Thompson <dthompson2@worcester.edu>2014-03-29 16:13:53 -0400
commit2fd537d6ecaa428068ad0576cafcd1254e5e654f (patch)
tree8494210f19c22b843cad87aadee8e6aa97f6767d
parent864c44a02357ceb89261b0e5330c01323ae20e26 (diff)
Don't open window upon importing the (2d window) module.
* 2d/window.scm (open-window): Remove default argument. * examples/common.scm: Open a window.
-rw-r--r--2d/window.scm9
-rw-r--r--examples/common.scm1
2 files changed, 2 insertions, 8 deletions
diff --git a/2d/window.scm b/2d/window.scm
index a747acf..9b01e13 100644
--- a/2d/window.scm
+++ b/2d/window.scm
@@ -89,7 +89,7 @@
(lambda (e)
(run-hook window-close-hook)))
-(define* (open-window window)
+(define* (open-window #:optional (window (make-window #:title "")))
"Open the game window using the settings in WINDOW."
(let ((flags (if (window-fullscreen? window) '(opengl fullscreen) 'opengl))
(width (vx (window-resolution window)))
@@ -116,10 +116,3 @@
(lambda () (open-window window))
(lambda () body ...)
(lambda () (close-window))))
-
-;; Open a window immediately to create an OpenGL context. This allows
-;; for textures to be loaded before the program explicitly sets the
-;; window settings.
-;;
-;; TODO: Hide the window initially. This will require SDL 2.0.
-(open-window (make-window #:title ""))
diff --git a/examples/common.scm b/examples/common.scm
index 8b1263d..b9675eb 100644
--- a/examples/common.scm
+++ b/examples/common.scm
@@ -23,6 +23,7 @@
(2d signal)
(2d window))
+(open-window)
(add-hook! key-press-hook (lambda (key unicode)
(when (eq? key 'escape)
(quit-game))))