From 03072ef67af0623758a660e2cd3fb5e153133efa Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 24 May 2023 08:09:03 -0400 Subject: Update chickadee manual. --- manuals/chickadee/The-Game-Loop.html | 94 +++++++++++++++++++++++++++--------- 1 file changed, 72 insertions(+), 22 deletions(-) (limited to 'manuals/chickadee/The-Game-Loop.html') diff --git a/manuals/chickadee/The-Game-Loop.html b/manuals/chickadee/The-Game-Loop.html index 7d7acfb..45a4d42 100644 --- a/manuals/chickadee/The-Game-Loop.html +++ b/manuals/chickadee/The-Game-Loop.html @@ -1,6 +1,6 @@ - - + --> + - + The Game Loop (The Chickadee Game Toolkit) - - - - - - - - - - - + + + + + + + + + + + - + @@ -84,7 +84,7 @@ ul.no-bullet {list-style: none}

Next: , Up: Kernel   [Contents][Index]

-
+

5.1.1 The Game Loop

At the very core of Chickadee there is an event loop. This loop, or @@ -102,7 +102,7 @@ Chickadee game loop. calling run-game is already taken care of for you.

-
Procedure: run-game [#:window-title "Chickadee!"] [#:window-width 640] [#:window-height 480] [#:window-fullscreen? #f] [#:window-resizable? #f] [#:update-hz 60] [#:load] [#:update] [#:draw] [#:quit] [#:key-press] [#:key-release] [#:text-input] [#:mouse-press] [#:mouse-release] [#:mouse-move] [#:controller-add] [#:controller-remove] [#:controller-press] [#:controller-release] [#:controller-move] [#:error]
+
Procedure: run-game [#:window-title "Chickadee!"] [#:window-width 640] [#:window-height 480] [#:window-fullscreen? #f] [#:window-resizable? #f] [#:update-hz 60] [#:clear-color] [#:load] [#:update] [#:draw] [#:quit] [#:key-press] [#:key-release] [#:text-input] [#:mouse-press] [#:mouse-release] [#:mouse-move] [#:controller-add] [#:controller-remove] [#:controller-press] [#: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.

@@ -110,7 +110,8 @@ calling run-game is already taken care of for you. window-height as its dimensions, window-title as its title, and in fullscreen mode if window-fullscreen? is #t. If window-resizable? is #t then the window -can be resized by the user. +can be resized by the user. The screen color will be set to +clear-color, or a pleasant light blue, by default.

  • load: Called with zero arguments when the game window has opened @@ -277,6 +278,55 @@ values are:
  • +
  • window-keyboard-enter: Called with zero arguments when the +window gains keyboard focus. + +
  • window-keyboard-leave: Called with zero arguments when the +window loses keyboard focus. + +
  • window-mouse-enter: Called with zero arguments when the window +gains mouse focus. + +
  • window-mouse-leave: Called with zero arguments when the window +loses mouse focus. + +
  • window-show: Called with zero arguments when the window is +shown after having been hidden. + +
  • window-hide: Called with zero arguments when the window is +hidden. + +
  • window-minimize: Called with zero arguments when the window is +minimized. + +
  • window-maximize: Called with zero arguments when the window is +maximized. + +
  • window-move: Called with two arguments when the window is moved +within the desktop environment. + +
      +
    1. x: The x coordinate of the top-left corner of the window, in +pixels. + +
    2. y: The y coordinate of the top-left corner of the window, in +pixels. + +
    + +

    Desktop environments use the top-left corner as the origin rather than +the bottom-left like Chickadee does, hence the discrepancy here. +

    +
  • window-resize: Called with zero arguments when the window is +resized. + +
      +
    1. width: The new width in pixels. + +
    2. height: The new height in pixels. + +
    +
  • error: Called with two arguments when an error occurs:
      @@ -358,7 +408,7 @@ behavior is to simply re-throw the error.

      Return the current value of the system timer in seconds.

-
+

Next: , Up: Kernel   [Contents][Index]

-- cgit v1.2.3