summaryrefslogtreecommitdiff
path: root/engine/node.scm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/node.scm')
-rw-r--r--engine/node.scm47
1 files changed, 25 insertions, 22 deletions
diff --git a/engine/node.scm b/engine/node.scm
index d95cfd9..5f2434b 100644
--- a/engine/node.scm
+++ b/engine/node.scm
@@ -1,5 +1,6 @@
;;; Lisp Game Jam 2018
;;; Copyright © 2018 David Thompson <davet@gnu.org>
+;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This program is free software: you can redistribute it and/or
;;; modify it under the terms of the GNU General Public License as
@@ -16,7 +17,7 @@
;;; <http://www.gnu.org/licenses/>.
(define-module (engine node)
- #:use-module (chickadee)
+ #:use-module (chickadee sdl)
#:use-module (chickadee math matrix)
#:use-module (chickadee math quaternion)
#:use-module (chickadee math vector)
@@ -228,24 +229,26 @@ one."
(window-height 480)
window-fullscreen?
(update-hz 60))
- (add-hook! load-hook
- (lambda ()
- (set-root-node! (make-root-node))))
- (add-hook! draw-hook (cut draw/children *root-node* <>))
- (add-hook! update-hook (cut update/children *root-node* <>))
- (add-hook! quit-hook
- (lambda ()
- (visit-while (cut on-quit <>) *root-node*)))
- (add-hook! key-press-hook
- (lambda (key sc mods repeat?)
- (visit-while (cut on-key-press <> key mods repeat?)
- *root-node*)))
- (add-hook! text-input-hook
- (lambda (text)
- (visit-while (cut on-text-edit <> text)
- *root-node*)))
- (run-game #:window-title window-title
- #:window-width window-width
- #:window-height window-height
- #:window-fullscreen? window-fullscreen?
- #:update-hz update-hz))
+ (run-game/sdl #:window-title window-title
+ #:window-width window-width
+ #:window-height window-height
+ #:window-fullscreen? window-fullscreen?
+ #:update-hz update-hz
+ #:load
+ (lambda ()
+ (set-root-node! (make-root-node)))
+ #:draw
+ (cut draw/children *root-node* <>)
+ #:update
+ (cut update/children *root-node* <>)
+ #:quit
+ (lambda ()
+ (visit-while (cut on-quit <>) *root-node*))
+ #:key-press
+ (lambda (key sc mods repeat?)
+ (visit-while (cut on-key-press <> key mods repeat?)
+ *root-node*))
+ #:text-input
+ (lambda (text)
+ (visit-while (cut on-text-edit <> text)
+ *root-node*))))