diff options
author | David Thompson <dthompson2@worcester.edu> | 2014-06-28 16:23:19 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2014-08-25 19:33:07 -0400 |
commit | 9878e5b5278b5fcbfc58d07a275b32a990760d89 (patch) | |
tree | 9751640944587afeb2a68d9405f23b08931239d5 | |
parent | 99a370a92f8eb75023e957f64e17430db4c44159 (diff) |
Reset video mode when window is resized.
* 2d/window.scm: Reset SDL video mode when video-resize is triggered.
-rw-r--r-- | sly/window.scm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sly/window.scm b/sly/window.scm index 934ef5f..aa3653a 100644 --- a/sly/window.scm +++ b/sly/window.scm @@ -63,9 +63,11 @@ (register-event-handler 'video-resize (lambda (e) - (run-hook window-resize-hook - (SDL:event:resize:w e) - (SDL:event:resize:h e)))) + (let ((width (SDL:event:resize:w e)) + (height (SDL:event:resize:h e))) + ;; Reset video mode. + (SDL:set-video-mode width height 24 '(opengl)) + (run-hook window-resize-hook width height)))) (define-signal window-size (hook->signal window-resize-hook |