summaryrefslogtreecommitdiff
path: root/manuals/chickadee/The-Game-Loop.html
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2023-05-24 08:09:03 -0400
committerDavid Thompson <dthompson2@worcester.edu>2023-05-24 08:09:03 -0400
commit03072ef67af0623758a660e2cd3fb5e153133efa (patch)
treeeea30b2b8fd47aa7d1bd6494ed64b4313f03eb4a /manuals/chickadee/The-Game-Loop.html
parentbcccc363a3b814930856be06c52914fb88c2ece6 (diff)
Update chickadee manual.
Diffstat (limited to 'manuals/chickadee/The-Game-Loop.html')
-rw-r--r--manuals/chickadee/The-Game-Loop.html94
1 files changed, 72 insertions, 22 deletions
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 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
-<!-- Copyright (C) 2017-2021 David Thompson davet@gnu.org
+<!-- Copyright (C) 2017-2023 David Thompson dthompson2@worcester.edu
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
@@ -17,25 +17,25 @@ Foundation Web site at http://www.gnu.org/licenses/fdl.html.
The document was typeset with
http://www.texinfo.org/ (GNU Texinfo).
- -->
-<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
+ -->
+<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The Game Loop (The Chickadee Game Toolkit)</title>
-<meta name="description" content="The Game Loop (The Chickadee Game Toolkit)">
-<meta name="keywords" content="The Game Loop (The Chickadee Game Toolkit)">
-<meta name="resource-type" content="document">
-<meta name="distribution" content="global">
-<meta name="Generator" content="makeinfo">
-<link href="index.html" rel="start" title="Top">
-<link href="Index.html" rel="index" title="Index">
-<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
-<link href="Kernel.html" rel="up" title="Kernel">
-<link href="Input-Devices.html" rel="next" title="Input Devices">
-<link href="Kernel.html" rel="prev" title="Kernel">
+<meta name="description" content="The Game Loop (The Chickadee Game Toolkit)" />
+<meta name="keywords" content="The Game Loop (The Chickadee Game Toolkit)" />
+<meta name="resource-type" content="document" />
+<meta name="distribution" content="global" />
+<meta name="Generator" content="makeinfo" />
+<link href="index.html" rel="start" title="Top" />
+<link href="Index.html" rel="index" title="Index" />
+<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents" />
+<link href="Kernel.html" rel="up" title="Kernel" />
+<link href="Input-Devices.html" rel="next" title="Input Devices" />
+<link href="Kernel.html" rel="prev" title="Kernel" />
<style type="text/css">
-<!--
+&lt;!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
div.display {margin-left: 3.2em}
@@ -72,9 +72,9 @@ ul.no-bullet {list-style: none}
}
}
--->
+--&gt;
</style>
-<link rel="stylesheet" type="text/css" href="https://dthompson.us/css/dthompson.css">
+<link rel="stylesheet" type="text/css" href="https://dthompson.us/css/dthompson.css" />
</head>
@@ -84,7 +84,7 @@ ul.no-bullet {list-style: none}
<p>
Next: <a href="Input-Devices.html" accesskey="n" rel="next">Input Devices</a>, Up: <a href="Kernel.html" accesskey="u" rel="up">Kernel</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html" title="Index" rel="index">Index</a>]</p>
</div>
-<hr>
+<hr />
<span id="The-Game-Loop-1"></span><h4 class="subsection">5.1.1 The Game Loop</h4>
<p>At the very core of Chickadee there is an event loop. This loop, or
@@ -102,7 +102,7 @@ Chickadee game loop.
calling <code>run-game</code> is already taken care of for you.
</p>
<dl>
-<dt id="index-run_002dgame">Procedure: <strong>run-game</strong> <em>[#:window-title &quot;Chickadee!&quot;] [#:window-width 640] [#:window-height 480] [#:window-fullscreen? <code>#f</code>] [#:window-resizable? <code>#f</code>] [#: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]</em></dt>
+<dt id="index-run_002dgame">Procedure: <strong>run-game</strong> <em>[#:window-title "Chickadee!"] [#:window-width 640] [#:window-height 480] [#:window-fullscreen? <code>#f</code>] [#:window-resizable? <code>#f</code>] [#: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]</em></dt>
<dd>
<p>Run the Chickadee game loop.
</p>
@@ -110,7 +110,8 @@ calling <code>run-game</code> is already taken care of for you.
<var>window-height</var> as its dimensions, <var>window-title</var> as its
title, and in fullscreen mode if <var>window-fullscreen?</var> is
<code>#t</code>. If <var>window-resizable?</var> is <code>#t</code> then the window
-can be resized by the user.
+can be resized by the user. The screen color will be set to
+<var>clear-color</var>, or a pleasant light blue, by default.
</p>
<ul>
<li> <var>load</var>: Called with zero arguments when the game window has opened
@@ -277,6 +278,55 @@ values are:
</li></ol>
+</li><li> <var>window-keyboard-enter</var>: Called with zero arguments when the
+window gains keyboard focus.
+
+</li><li> <var>window-keyboard-leave</var>: Called with zero arguments when the
+window loses keyboard focus.
+
+</li><li> <var>window-mouse-enter</var>: Called with zero arguments when the window
+gains mouse focus.
+
+</li><li> <var>window-mouse-leave</var>: Called with zero arguments when the window
+loses mouse focus.
+
+</li><li> <var>window-show</var>: Called with zero arguments when the window is
+shown after having been hidden.
+
+</li><li> <var>window-hide</var>: Called with zero arguments when the window is
+hidden.
+
+</li><li> <var>window-minimize</var>: Called with zero arguments when the window is
+minimized.
+
+</li><li> <var>window-maximize</var>: Called with zero arguments when the window is
+maximized.
+
+</li><li> <var>window-move</var>: Called with two arguments when the window is moved
+within the desktop environment.
+
+<ol>
+<li> <var>x</var>: The x coordinate of the top-left corner of the window, in
+pixels.
+
+</li><li> <var>y</var>: The y coordinate of the top-left corner of the window, in
+pixels.
+
+</li></ol>
+
+<p>Desktop environments use the top-left corner as the origin rather than
+the bottom-left like Chickadee does, hence the discrepancy here.
+</p>
+</li><li> <var>window-resize</var>: Called with zero arguments when the window is
+resized.
+
+<ol>
+<li> <var>width</var>: The new width in pixels.
+
+</li><li> <var>height</var>: The new height in pixels.
+
+</li></ol>
+
</li><li> <var>error</var>: Called with two arguments when an error occurs:
<ol>
@@ -358,7 +408,7 @@ behavior is to simply re-throw the error.
<dd><p>Return the current value of the system timer in seconds.
</p></dd></dl>
-<hr>
+<hr />
<div class="header">
<p>
Next: <a href="Input-Devices.html" accesskey="n" rel="next">Input Devices</a>, Up: <a href="Kernel.html" accesskey="u" rel="up">Kernel</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html" title="Index" rel="index">Index</a>]</p>