summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2021-05-13 21:01:45 -0400
committerDavid Thompson <dthompson2@worcester.edu>2021-05-13 21:01:45 -0400
commitdc7520bff1c5544811d9f22b45920eb5fe02fac5 (patch)
tree2b43a033913b5bb28f31af706f844106ac5248d8
parentb07a1b84e04bad8dd093342b4ac59de455f19b9c (diff)
Add warp-mouse and set-show-cursor! procedures.
-rw-r--r--chickadee.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/chickadee.scm b/chickadee.scm
index 989056b..8adc313 100644
--- a/chickadee.scm
+++ b/chickadee.scm
@@ -74,6 +74,8 @@
mouse-y
mouse-button-pressed?
mouse-button-released?
+ warp-mouse
+ set-show-cursor!
run-game)
#:re-export (abort-game))
@@ -107,6 +109,9 @@
"Return #t if BUTTON is not currently being pressed."
(sdl2:mouse-button-released? button))
+(define (set-show-cursor! show?)
+ (sdl2:set-show-cursor! show?))
+
(define *controllers* (make-hash-table))
(define (lookup-controller joystick-id)
@@ -241,6 +246,9 @@ border is disabled, otherwise it is enabled.")
"Move the upper-left corner of WINDOW to pixel coordinates (X, Y)."
(sdl2:set-window-position! (unwrap-window window) x y))
+(define (warp-mouse x y)
+ (sdl2:warp-mouse x y (unwrap-window (current-window))))
+
(define* (run-game #:key
(window-title "Chickadee!")
(window-width 640)