summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)