diff options
author | David Thompson <dthompson2@worcester.edu> | 2013-07-29 18:44:54 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2013-07-29 18:44:54 -0400 |
commit | 36b7e77057e093f7e2d599d8ad8ad0c7cef84867 (patch) | |
tree | c1963b7c1b4e043f64447d72cc23cfebe4242223 | |
parent | 0de1284f1d3b128f48fe00dc6d8df4e9a4aaa56f (diff) |
Update example code in README.
-rw-r--r-- | README.org | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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) |