summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2015-03-17 11:48:01 -0400
committerDavid Thompson <dthompson2@worcester.edu>2015-03-17 11:48:01 -0400
commita915b370094a59f868b6d49ab50e10c062600b46 (patch)
tree7b3b84aa1902a2a0655d89f0e3e4afa9a9b5f7a1
parent48fe4e0d5ccdd52f4688811d28e54dd5fc2abdbd (diff)
window: Throw an exception when SDL window cannot be opened.
* sly/window.scm (open-window): Throw error when 'SDL:set-video-mode' fails.
-rw-r--r--sly/window.scm3
1 files changed, 2 insertions, 1 deletions
diff --git a/sly/window.scm b/sly/window.scm
index 0846855..0ee28cb 100644
--- a/sly/window.scm
+++ b/sly/window.scm
@@ -99,7 +99,8 @@
(SDL:enable-unicode #t)
(SDL:init 'everything)
;; Open SDL window in OpenGL mode.
- (SDL:set-video-mode width height 24 flags)
+ (unless (SDL:set-video-mode width height 24 flags)
+ (error "Failed to open window:" width height flags))
(SDL:set-caption (window-title window))))
(define (close-window)