summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2023-05-13 11:21:13 -0400
committerDavid Thompson <dthompson2@worcester.edu>2023-05-13 11:21:13 -0400
commit0fe14aaf972b0cc00a7f7c3162c39b0ad422d7d9 (patch)
tree3f39bee58c4c3531ed964b65b040ff2e1f41133f /doc
parent2537c5bf6da4972ad5b23de2f01ad6944e3bc2bb (diff)
Add window event handlers to run-game.
Diffstat (limited to 'doc')
-rw-r--r--doc/api.texi73
1 files changed, 72 insertions, 1 deletions
diff --git a/doc/api.texi b/doc/api.texi
index b9e2229..468c5a3 100644
--- a/doc/api.texi
+++ b/doc/api.texi
@@ -46,7 +46,13 @@ calling @code{run-game} is already taken care of for you.
[#:key-press] [#:key-release] [#:text-input] @
[#:mouse-press] [#:mouse-release] [#:mouse-move] @
[#:controller-add] [#:controller-remove] [#:controller-press] @
- [#:controller-release] [#:controller-move] [#:error]
+ [#:controller-release] [#:controller-move] @
+ [#:window-keyboard-enter] [#:window-keyboard-leave] @
+ [#:window-mouse-enter] [#:window-mouse-leave] @
+ [#:window-show] [#:window-hide] @
+ [#:window-minimize] [#:window-maximize] @
+ [#:window-move] [#:window-resize] @
+ [#:error]
Run the Chickadee game loop.
@@ -292,6 +298,71 @@ values are:
@end enumerate
@item
+@var{window-keyboard-enter}: Called with zero arguments when the
+window gains keyboard focus.
+
+@item
+@var{window-keyboard-leave}: Called with zero arguments when the
+window loses keyboard focus.
+
+@item
+@var{window-mouse-enter}: Called with zero arguments when the window
+gains mouse focus.
+
+@item
+@var{window-mouse-leave}: Called with zero arguments when the window
+loses mouse focus.
+
+@item
+@var{window-show}: Called with zero arguments when the window is
+shown after having been hidden.
+
+@item
+@var{window-hide}: Called with zero arguments when the window is
+hidden.
+
+@item
+@var{window-minimize}: Called with zero arguments when the window is
+minimized.
+
+@item
+@var{window-maximize}: Called with zero arguments when the window is
+maximized.
+
+@item
+@var{window-move}: Called with two arguments when the window is moved
+within the desktop environment.
+
+@enumerate
+
+@item
+@var{x}: The x coordinate of the top-left corner of the window, in
+pixels.
+
+@item
+@var{y}: The y coordinate of the top-left corner of the window, in
+pixels.
+
+@end enumerate
+
+Desktop environments use the top-left corner as the origin rather than
+the bottom-left like Chickadee does, hence the discrepancy here.
+
+@item
+@var{window-resize}: Called with zero arguments when the window is
+resized.
+
+@enumerate
+
+@item
+@var{width}: The new width in pixels.
+
+@item
+@var{height}: The new height in pixels.
+
+@end enumerate
+
+@item
@var{error}: Called with two arguments when an error occurs:
@enumerate