summaryrefslogtreecommitdiff
path: root/2d
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-01-26 14:20:34 -0500
committerDavid Thompson <dthompson2@worcester.edu>2014-01-26 14:20:34 -0500
commit0b957a40ae993bf337830bc30915a13c0be99af3 (patch)
treeced18fbd1f356cfae2b9237fa751a68df598131c /2d
parent86a27fd7fd9cdd8404066ec8d8b6c9a30718aebf (diff)
Add window-resize-hook.
* 2d/window.scm (window-resize-hook): New hook.
Diffstat (limited to '2d')
-rw-r--r--2d/window.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/2d/window.scm b/2d/window.scm
index c62c7b6..238860b 100644
--- a/2d/window.scm
+++ b/2d/window.scm
@@ -40,7 +40,8 @@
window-size
open-window
close-window
- with-window))
+ with-window
+ window-resize-hook))
(define-record-type <window>
(%make-window title resolution fullscreen?)
@@ -58,10 +59,14 @@
(define window-width (make-root-signal 0))
(define window-height (make-root-signal 0))
(define window-size (signal-map vector2 window-width window-height))
+(define window-resize-hook (make-hook 2))
(register-event-handler
'video-resize
(lambda (e)
+ (run-hook window-resize-hook
+ (SDL:event:resize:w e)
+ (SDL:event:resize:h e))
(signal-set! window-width (SDL:event:resize:w e))
(signal-set! window-height (SDL:event:resize:h e))))