summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2013-07-29 18:44:54 -0400
committerDavid Thompson <dthompson2@worcester.edu>2013-07-29 18:44:54 -0400
commit36b7e77057e093f7e2d599d8ad8ad0c7cef84867 (patch)
treec1963b7c1b4e043f64447d72cc23cfebe4242223
parent0de1284f1d3b128f48fe00dc6d8df4e9a4aaa56f (diff)
Update example code in README.
-rw-r--r--README.org8
1 files changed, 5 insertions, 3 deletions
diff --git a/README.org b/README.org
index e207635..693cb6f 100644
--- a/README.org
+++ b/README.org
@@ -42,9 +42,11 @@
(define (render)
(draw-sprite sprite))
- ;; Register callbacks.
- (set-render-callback (lambda () (render)))
- (set-key-down-callback (lambda (key) (key-down key)))
+ ;; Register hooks. Lambdas are used as "trampolines" so that render
+ ;; and key-down can be redefined later and the hooks will call the
+ ;; updated procedures.
+ (add-hook! on-render-hook (lambda () (render)))
+ (add-hook! on-key-down-hook (lambda (key) (key-down key)))
;; Open the window.
(open-window window-width window-height)