summaryrefslogtreecommitdiff
path: root/chickadee.scm
diff options
context:
space:
mode:
Diffstat (limited to 'chickadee.scm')
-rw-r--r--chickadee.scm9
1 files changed, 9 insertions, 0 deletions
diff --git a/chickadee.scm b/chickadee.scm
index e14f924..0b46237 100644
--- a/chickadee.scm
+++ b/chickadee.scm
@@ -38,9 +38,11 @@
#:use-module (chickadee render gl)
#:use-module (chickadee render gpu)
#:use-module (chickadee render viewport)
+ #:use-module (chickadee utils)
#:export (current-window
controller-button-pressed?
controller-axis
+ controller-name
key-pressed?
key-released?
mouse-x
@@ -108,6 +110,13 @@ not being pushed at all."
(/ (sdl2:game-controller-axis controller axis)
32768.0))
+(define controller-name
+ ;; Memoize to avoid repeated allocation of strings via
+ ;; pointer->string.
+ (memoize
+ (lambda (controller)
+ (sdl2:game-controller-name controller))))
+
(define current-window (make-parameter #f))
(define* (run-game #:key