diff options
author | David Thompson <dthompson2@worcester.edu> | 2013-07-21 21:22:26 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2013-07-21 21:40:34 -0400 |
commit | 19ef3684c05426af1abb65e2a1a29234fd5e0bc1 (patch) | |
tree | e7f678e5a3539bef6a5b14831c7818bc8a19cf21 /2d | |
parent | 7c2de24f545285bbd57a96f228878a2a7b2f34be (diff) |
Update to guile-sdl 0.5.0 API.
Diffstat (limited to '2d')
-rw-r--r-- | 2d/game-loop.scm | 14 | ||||
-rw-r--r-- | 2d/window.scm | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/2d/game-loop.scm b/2d/game-loop.scm index 9e743c7..92eff2a 100644 --- a/2d/game-loop.scm +++ b/2d/game-loop.scm @@ -91,36 +91,36 @@ (define (handle-event e) "Calls the relevant callback for the event." (case (SDL:event:type e) - ((SDL_KEYDOWN) + ((key-down) (key-down-callback (event-keycode e) (event-keymods e) (SDL:event:key:keysym:unicode e))) - ((SDL_KEYUP) + ((key-up) (key-up-callback (event-keycode e) (event-keymods e) (SDL:event:key:keysym:unicode e))) - ((SDL_MOUSEMOTION) + ((mouse-motion) (mouse-motion-callback (SDL:event:motion:state e) (SDL:event:motion:x e) (SDL:event:motion:y e) (SDL:event:motion:xrel e) (SDL:event:motion:yrel e))) - ((SDL_MOUSEBUTTONDOWN) + ((mouse-button-down) (mouse-button-down-callback (SDL:event:button:button e) (SDL:event:button:x e) (SDL:event:button:y e))) - ((SDL_MOUSEBUTTONUP) + ((mouse-button-up) (mouse-button-up-callback (SDL:event:button:button e) (SDL:event:button:x e) (SDL:event:button:y e))))) (define (event-keycode e) "Returns an integer keycode from an SDL event." - (SDL:enum->number SDL:event-keys (SDL:event:key:keysym:sym e))) + (SDL:enum->number 'keysym (SDL:event:key:keysym:sym e))) (define (event-keymods e) "Returns an integer bitmask of keymods from an SDL event" - (SDL:flags->number (SDL:flagstash:event-mod) (SDL:event:key:keysym:mod e))) + (SDL:flags->number 'keyboard-modifier (SDL:event:key:keysym:mod e))) ;;; ;;; Update and Render diff --git a/2d/window.scm b/2d/window.scm index 72dfc4d..5f82df1 100644 --- a/2d/window.scm +++ b/2d/window.scm @@ -33,7 +33,7 @@ (define (init-2d) "Initializes guile-2d. This procedure must be called before using the rest of the framework." - (SDL:init '(SDL_INIT_EVERYTHING)) + (SDL:init 'everything) ;; Enable unicode key events (SDL:enable-unicode #t)) @@ -41,7 +41,7 @@ the rest of the framework." "Creates the game window with the specified dimensions and initializes OpenGL state." ;; Open SDL window in OpenGL mode. - (SDL:set-video-mode width height depth '(SDL_OPENGL)) + (SDL:set-video-mode width height depth 'opengl) (SDL:set-caption title) ;; Initialize OpenGL orthographic view (gl-viewport 0 0 width height) |