summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-01-22 20:08:38 -0500
committerDavid Thompson <dthompson2@worcester.edu>2014-01-22 20:08:38 -0500
commit87bdccb3b3b4f7cd3c63b0cea5ab4e73b31ac863 (patch)
treea60f1dccccd2d7266c02d2eb5d9096f34b79d12f
parent7c540f61a710847fd59033d3d2ee1dfc6364b928 (diff)
Initialize audio in audio module instead of window module.
* 2d/window.scm (open-window, close-window): Remove open/close audio calls. * 2d/audio.scm: Open audio when module is imported.
-rw-r--r--2d/audio.scm2
-rw-r--r--2d/window.scm2
2 files changed, 2 insertions, 2 deletions
diff --git a/2d/audio.scm b/2d/audio.scm
index 2978a22..15eaaa5 100644
--- a/2d/audio.scm
+++ b/2d/audio.scm
@@ -26,6 +26,8 @@
#:use-module (srfi srfi-2)
#:use-module ((sdl mixer) #:prefix SDL:))
+(SDL:open-audio)
+
;; Wrapper over SDL audio objects.
(define-record-type <sample>
(make-sample audio)
diff --git a/2d/window.scm b/2d/window.scm
index 1d82a97..c62c7b6 100644
--- a/2d/window.scm
+++ b/2d/window.scm
@@ -73,7 +73,6 @@
;; Initialize everything
(SDL:enable-unicode #t)
(SDL:init 'everything)
- (SDL:open-audio)
;; Open SDL window in OpenGL mode.
(SDL:set-video-mode width height 24 flags)
(SDL:set-caption (window-title window))
@@ -92,7 +91,6 @@
(define (close-window)
"Close the currently open window and audio."
- (SDL:close-audio)
(SDL:quit))
(define-syntax-rule (with-window window body ...)