From 25c5eac5e6ca1035db1eddd7bea9ac78531da57e Mon Sep 17 00:00:00 2001 From: David Thompson Date: Thu, 28 Dec 2023 11:23:49 -0500 Subject: Delete manuals! Good riddance! These are hosted on files.dthompson.us now! --- manuals/chickadee/API-Reference.html | 109 --- manuals/chickadee/Agendas.html | 223 ----- manuals/chickadee/Apache-2_002e0-License.html | 305 ------- manuals/chickadee/Array-Lists.html | 179 ---- manuals/chickadee/Audio-Files.html | 221 ----- manuals/chickadee/Audio.html | 123 --- manuals/chickadee/Basics.html | 140 --- manuals/chickadee/Bezier-Curves.html | 161 ---- manuals/chickadee/Buffers.html | 482 ---------- manuals/chickadee/Channels.html | 157 ---- manuals/chickadee/Colors.html | 377 -------- manuals/chickadee/Command-Line-Interface.html | 104 --- manuals/chickadee/Copying-This-Manual.html | 99 --- manuals/chickadee/Data-Structures.html | 109 --- manuals/chickadee/Easings.html | 171 ---- manuals/chickadee/Fonts.html | 184 ---- manuals/chickadee/Framebuffers.html | 147 --- manuals/chickadee/Getting-Started.html | 177 ---- manuals/chickadee/Graphics.html | 145 --- manuals/chickadee/Grids.html | 214 ----- manuals/chickadee/Heaps.html | 139 --- manuals/chickadee/Index.html | 1034 ---------------------- manuals/chickadee/Input-Devices.html | 156 ---- manuals/chickadee/Installation.html | 107 --- manuals/chickadee/Invoking-chickadee-bundle.html | 219 ----- manuals/chickadee/Invoking-chickadee-play.html | 239 ----- manuals/chickadee/Kernel.html | 106 --- manuals/chickadee/Lights.html | 212 ----- manuals/chickadee/Live-Coding.html | 133 --- manuals/chickadee/Math.html | 116 --- manuals/chickadee/Matrices.html | 409 --------- manuals/chickadee/Meshes.html | 413 --------- manuals/chickadee/Models.html | 167 ---- manuals/chickadee/Particles.html | 252 ------ manuals/chickadee/Path-Finding.html | 171 ---- manuals/chickadee/Quadtrees.html | 222 ----- manuals/chickadee/Quaternions.html | 137 --- manuals/chickadee/Queues.html | 133 --- manuals/chickadee/Rectangles.html | 330 ------- manuals/chickadee/Render-Settings.html | 512 ----------- manuals/chickadee/Rendering-Engine.html | 176 ---- manuals/chickadee/Requirements.html | 107 --- manuals/chickadee/Scripting.html | 118 --- manuals/chickadee/Scripts.html | 212 ----- manuals/chickadee/Shaders.html | 405 --------- manuals/chickadee/Skyboxes.html | 119 --- manuals/chickadee/Sources.html | 336 ------- manuals/chickadee/Sprites.html | 233 ----- manuals/chickadee/Textures.html | 297 ------- manuals/chickadee/The-Environment.html | 152 ---- manuals/chickadee/The-Game-Loop.html | 420 --------- manuals/chickadee/The-Listener.html | 141 --- manuals/chickadee/Tile-Maps.html | 366 -------- manuals/chickadee/Tweening.html | 123 --- manuals/chickadee/Vector-Paths.html | 462 ---------- manuals/chickadee/Vectors.html | 351 -------- manuals/chickadee/Viewports.html | 163 ---- manuals/chickadee/Window-Manipulation.html | 190 ---- manuals/chickadee/index.html | 267 ------ 59 files changed, 13672 deletions(-) delete mode 100644 manuals/chickadee/API-Reference.html delete mode 100644 manuals/chickadee/Agendas.html delete mode 100644 manuals/chickadee/Apache-2_002e0-License.html delete mode 100644 manuals/chickadee/Array-Lists.html delete mode 100644 manuals/chickadee/Audio-Files.html delete mode 100644 manuals/chickadee/Audio.html delete mode 100644 manuals/chickadee/Basics.html delete mode 100644 manuals/chickadee/Bezier-Curves.html delete mode 100644 manuals/chickadee/Buffers.html delete mode 100644 manuals/chickadee/Channels.html delete mode 100644 manuals/chickadee/Colors.html delete mode 100644 manuals/chickadee/Command-Line-Interface.html delete mode 100644 manuals/chickadee/Copying-This-Manual.html delete mode 100644 manuals/chickadee/Data-Structures.html delete mode 100644 manuals/chickadee/Easings.html delete mode 100644 manuals/chickadee/Fonts.html delete mode 100644 manuals/chickadee/Framebuffers.html delete mode 100644 manuals/chickadee/Getting-Started.html delete mode 100644 manuals/chickadee/Graphics.html delete mode 100644 manuals/chickadee/Grids.html delete mode 100644 manuals/chickadee/Heaps.html delete mode 100644 manuals/chickadee/Index.html delete mode 100644 manuals/chickadee/Input-Devices.html delete mode 100644 manuals/chickadee/Installation.html delete mode 100644 manuals/chickadee/Invoking-chickadee-bundle.html delete mode 100644 manuals/chickadee/Invoking-chickadee-play.html delete mode 100644 manuals/chickadee/Kernel.html delete mode 100644 manuals/chickadee/Lights.html delete mode 100644 manuals/chickadee/Live-Coding.html delete mode 100644 manuals/chickadee/Math.html delete mode 100644 manuals/chickadee/Matrices.html delete mode 100644 manuals/chickadee/Meshes.html delete mode 100644 manuals/chickadee/Models.html delete mode 100644 manuals/chickadee/Particles.html delete mode 100644 manuals/chickadee/Path-Finding.html delete mode 100644 manuals/chickadee/Quadtrees.html delete mode 100644 manuals/chickadee/Quaternions.html delete mode 100644 manuals/chickadee/Queues.html delete mode 100644 manuals/chickadee/Rectangles.html delete mode 100644 manuals/chickadee/Render-Settings.html delete mode 100644 manuals/chickadee/Rendering-Engine.html delete mode 100644 manuals/chickadee/Requirements.html delete mode 100644 manuals/chickadee/Scripting.html delete mode 100644 manuals/chickadee/Scripts.html delete mode 100644 manuals/chickadee/Shaders.html delete mode 100644 manuals/chickadee/Skyboxes.html delete mode 100644 manuals/chickadee/Sources.html delete mode 100644 manuals/chickadee/Sprites.html delete mode 100644 manuals/chickadee/Textures.html delete mode 100644 manuals/chickadee/The-Environment.html delete mode 100644 manuals/chickadee/The-Game-Loop.html delete mode 100644 manuals/chickadee/The-Listener.html delete mode 100644 manuals/chickadee/Tile-Maps.html delete mode 100644 manuals/chickadee/Tweening.html delete mode 100644 manuals/chickadee/Vector-Paths.html delete mode 100644 manuals/chickadee/Vectors.html delete mode 100644 manuals/chickadee/Viewports.html delete mode 100644 manuals/chickadee/Window-Manipulation.html delete mode 100644 manuals/chickadee/index.html (limited to 'manuals/chickadee') diff --git a/manuals/chickadee/API-Reference.html b/manuals/chickadee/API-Reference.html deleted file mode 100644 index 4b69116..0000000 --- a/manuals/chickadee/API-Reference.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - -API Reference (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Top   [Contents][Index]

-
-
-

5 API Reference

- - - - - - - - - - - - - - - diff --git a/manuals/chickadee/Agendas.html b/manuals/chickadee/Agendas.html deleted file mode 100644 index 51be160..0000000 --- a/manuals/chickadee/Agendas.html +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - -Agendas (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Up: Scripting   [Contents][Index]

-
-
-

5.5.1 Agendas

- -

To schedule a task to be performed later, an “agenda” is used. -There is a default, global agenda that is ready to be used, or -additional agendas may be created for different purposes. The -following example prints the text “hello” when the agenda has -advanced to time unit 10. -

-
-
(at 10 (display "hello\n"))
-
- -

Most of the time it is more convenient to schedule tasks relative to -the current time. This is where after comes in handy: -

-
-
(after 10 (display "hello\n"))
-
- -

Time units in the agenda are in no way connected to real time. It’s -up to the programmer to decide what agenda time means. A simple and -effective approach is to map each call of the update procedure -(see Kernel) to 1 unit of agenda time, like so: -

-
-
(define (update dt)
-  (update-agenda 1))
-
- -

It is important to call update-agenda periodically, otherwise -no tasks will ever be run! -

-

In addition to using the global agenda, it is useful to have multiple -agendas for different purposes. For example, the game world can use a -different agenda than the user interface, so that pausing the game is -a simple matter of not updating the world’s agenda while continuing to -update the user interface’s agenda. The current agenda is dynamically -scoped and can be changed using the with-agenda special form: -

-
-
(define game-world-agenda (make-agenda))
-
-(with-agenda game-world-agenda
-  (at 60 (spawn-goblin))
-  (at 120 (spawn-goblin))
-  (at 240 (spawn-goblin-king)))
-
- -
-
Procedure: make-agenda
-

Return a new task scheduler. -

- -
-
Procedure: agenda? obj
-

Return #t if obj is an agenda. -

- -
-
Procedure: current-agenda
-
Procedure: current-agenda agenda
-

When called with no arguments, return the current agenda. When called -with one argument, set the current agenda to agenda. -

- -
-
Syntax: with-agenda agenda body …
-

Evaluate body with the current agenda set to agenda. -

- -
-
Procedure: agenda-time
-

Return the current agenda time. -

- -
-
Procedure: update-agenda dt
-

Advance the current agenda by dt. -

- -
-
Procedure: schedule-at time thunk
-

Schedule thunk, a procedure of zero arguments, to be run at -time. -

- -
-
Procedure: schedule-after delay thunk
-

Schedule thunk, a procedure of zero arguments, to be run after -delay. -

- -
-
Procedure: schedule-every interval thunk [n]
-

Schedule thunk, a procedure of zero arguments, to be run every -interval amount of time. Repeat this n times, or -indefinitely if not specified. -

- -
-
Syntax: at time body …
-

Schedule body to be evaluated at time. -

- -
-
Syntax: after delay body …
-

Schedule body to be evaluated after delay. -

- -
-
Syntax: every interval body …
-
Syntax: every (interval n) body …
-

Schedule body to be evaluated every interval amount of -time. Repeat this n times, or indefinitely if not specified. -

- -

It is also possible to schedule things that are not dependent on how -much time passes. The agenda will periodically poll to see if any -registered conditions are met. -

-
-
Procedure: call-when pred thunk
-

Call thunk sometime in the future when pred is satisfied -(returns a value other than #f.) -

- -
-
-

-Next: , Up: Scripting   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Apache-2_002e0-License.html b/manuals/chickadee/Apache-2_002e0-License.html deleted file mode 100644 index 361c858..0000000 --- a/manuals/chickadee/Apache-2_002e0-License.html +++ /dev/null @@ -1,305 +0,0 @@ - - - - - - -Apache 2.0 License (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Up: Copying This Manual   [Contents][Index]

-
-
-

A.1 Apache 2.0 License

- -

Apache License -

-

Version 2.0, January 2004 -

-

http://www.apache.org/licenses/ -

-

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -

-
    -
  1. Definitions. - -

    “License” shall mean the terms and conditions for use, reproduction, -and distribution as defined by Sections 1 through 9 of this document. -

    -

    “Licensor” shall mean the copyright owner or entity authorized by -the copyright owner that is granting the License. -

    -

    “Legal Entity” shall mean the union of the acting entity and all -other entities that control, are controlled by, or are under common -control with that entity. For the purposes of this definition, -“control” means (i) the power, direct or indirect, to cause the -direction or management of such entity, whether by contract or -otherwise, or (ii) ownership of fifty percent (50%) or more of the -outstanding shares, or (iii) beneficial ownership of such entity. -

    -

    “You” (or “Your”) shall mean an individual or Legal Entity -exercising permissions granted by this License. -

    -

    “Source” form shall mean the preferred form for making modifications, -including but not limited to software source code, documentation -source, and configuration files. -

    -

    “Object” form shall mean any form resulting from mechanical -transformation or translation of a Source form, including but -not limited to compiled object code, generated documentation, -and conversions to other media types. -

    -

    “Work” shall mean the work of authorship, whether in Source or -Object form, made available under the License, as indicated by a -copyright notice that is included in or attached to the work -(an example is provided in the Appendix below). -

    -

    “Derivative Works” shall mean any work, whether in Source or Object -form, that is based on (or derived from) the Work and for which the -editorial revisions, annotations, elaborations, or other modifications -represent, as a whole, an original work of authorship. For the purposes -of this License, Derivative Works shall not include works that remain -separable from, or merely link (or bind by name) to the interfaces of, -the Work and Derivative Works thereof. -

    -

    “Contribution” shall mean any work of authorship, including -the original version of the Work and any modifications or additions -to that Work or Derivative Works thereof, that is intentionally -submitted to Licensor for inclusion in the Work by the copyright owner -or by an individual or Legal Entity authorized to submit on behalf of -the copyright owner. For the purposes of this definition, “submitted” -means any form of electronic, verbal, or written communication sent -to the Licensor or its representatives, including but not limited to -communication on electronic mailing lists, source code control systems, -and issue tracking systems that are managed by, or on behalf of, the -Licensor for the purpose of discussing and improving the Work, but -excluding communication that is conspicuously marked or otherwise -designated in writing by the copyright owner as “Not a Contribution.” -

    -

    “Contributor” shall mean Licensor and any individual or Legal Entity -on behalf of whom a Contribution has been received by Licensor and -subsequently incorporated within the Work. -

    -
  2. Grant of Copyright License. Subject to the terms and conditions of -this License, each Contributor hereby grants to You a perpetual, -worldwide, non-exclusive, no-charge, royalty-free, irrevocable -copyright license to reproduce, prepare Derivative Works of, -publicly display, publicly perform, sublicense, and distribute the -Work and such Derivative Works in Source or Object form. - -
  3. Grant of Patent License. Subject to the terms and conditions of -this License, each Contributor hereby grants to You a perpetual, -worldwide, non-exclusive, no-charge, royalty-free, irrevocable -(except as stated in this section) patent license to make, have made, -use, offer to sell, sell, import, and otherwise transfer the Work, -where such license applies only to those patent claims licensable -by such Contributor that are necessarily infringed by their -Contribution(s) alone or by combination of their Contribution(s) -with the Work to which such Contribution(s) was submitted. If You -institute patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Work -or a Contribution incorporated within the Work constitutes direct -or contributory patent infringement, then any patent licenses -granted to You under this License for that Work shall terminate -as of the date such litigation is filed. - -
  4. Redistribution. You may reproduce and distribute copies of the -Work or Derivative Works thereof in any medium, with or without -modifications, and in Source or Object form, provided that You -meet the following conditions: - -

    (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and -

    -

    (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and -

    -

    (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and -

    -

    (d) If the Work includes a “NOTICE” text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. -

    -

    You may add Your own copyright statement to Your modifications and -may provide additional or different license terms and conditions -for use, reproduction, or distribution of Your modifications, or -for any such Derivative Works as a whole, provided Your use, -reproduction, and distribution of the Work otherwise complies with -the conditions stated in this License. -

    -
  5. Submission of Contributions. Unless You explicitly state otherwise, -any Contribution intentionally submitted for inclusion in the Work -by You to the Licensor shall be under the terms and conditions of -this License, without any additional terms or conditions. -Notwithstanding the above, nothing herein shall supersede or modify -the terms of any separate license agreement you may have executed -with Licensor regarding such Contributions. - -
  6. Trademarks. This License does not grant permission to use the trade -names, trademarks, service marks, or product names of the Licensor, -except as required for reasonable and customary use in describing the -origin of the Work and reproducing the content of the NOTICE file. - -
  7. Disclaimer of Warranty. Unless required by applicable law or -agreed to in writing, Licensor provides the Work (and each -Contributor provides its Contributions) on an “AS IS” BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -implied, including, without limitation, any warranties or conditions -of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A -PARTICULAR PURPOSE. You are solely responsible for determining the -appropriateness of using or redistributing the Work and assume any -risks associated with Your exercise of permissions under this License. - -
  8. Limitation of Liability. In no event and under no legal theory, -whether in tort (including negligence), contract, or otherwise, -unless required by applicable law (such as deliberate and grossly -negligent acts) or agreed to in writing, shall any Contributor be -liable to You for damages, including any direct, indirect, special, -incidental, or consequential damages of any character arising as a -result of this License or out of the use or inability to use the -Work (including but not limited to damages for loss of goodwill, -work stoppage, computer failure or malfunction, or any and all -other commercial damages or losses), even if such Contributor -has been advised of the possibility of such damages. - -
  9. Accepting Warranty or Additional Liability. While redistributing -the Work or Derivative Works thereof, You may choose to offer, -and charge a fee for, acceptance of support, warranty, indemnity, -or other liability obligations and/or rights consistent with this -License. However, in accepting such obligations, You may act only -on Your own behalf and on Your sole responsibility, not on behalf -of any other Contributor, and only if You agree to indemnify, -defend, and hold each Contributor harmless for any liability -incurred by, or claims asserted against, such Contributor by reason -of your accepting any such warranty or additional liability. -
- -

END OF TERMS AND CONDITIONS -

-

APPENDIX: How to apply the Apache License to your work. -

-

To apply the Apache License to your work, attach the following -boilerplate notice, with the fields enclosed by brackets “[]” -replaced with your own identifying information. (Don’t include -the brackets!) The text should be enclosed in the appropriate -comment syntax for the file format. We also recommend that a -file or class name and description of purpose be included on the -same “printed page” as the copyright notice for easier -identification within third-party archives. -

-

Copyright [yyyy] [name of copyright owner] -

-

Licensed under the Apache License, Version 2.0 (the “License”); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at -

-

http://www.apache.org/licenses/LICENSE-2.0 -

-

Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an “AS IS” BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -

-
-
-

-Up: Copying This Manual   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Array-Lists.html b/manuals/chickadee/Array-Lists.html deleted file mode 100644 index ca30f16..0000000 --- a/manuals/chickadee/Array-Lists.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - -Array Lists (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Up: Data Structures   [Contents][Index]

-
-
-

5.6.1 Array Lists

- -

The (chickadee data array-list) module provides an array/vector -that dynamically expands to hold all of the data that is added to it. -It is named after the ArrayList class in Java. -

-

In addition to being used as a dynamic vector, it can also be used as -a stack via the array-list-push! and array-list-pop! -procedures. -

-
-
Procedure: make-array-list [initial-capacity]
-

Return a new empty array list with an initial capacity of -initial-capacity, or 32 by default. -

- -
-
Procedure: array-list items ...
-

Return a new array list with items in it. -

- -
-
Procedure: array-list? obj
-

Return #t if obj is an array list. -

- -
-
Procedure: array-list-empty? array-list
-

Return #t if array-list is empty. -

- -
-
Procedure: array-list-size array-list
-

Return the current size of array-list. -

- -
-
Procedure: array-list-ref array-list i
-

Return the item in array-list at index i. -

- -
-
Procedure: array-list-set! array-list i value
-

Set the value in array-list at index i to value. -

- -
-
Procedure: array-list-push! array-list item
-

Append item to array-list. -

- -
-
Procedure: array-list-pop! array-list
-

Remove and return the last object in array-list. -

- -
-
Procedure: array-list-delete! array-list item [#:equal? equal?] [#:fast? #f]
-

Delete item from array-list. Use equal? as the -equivalence predicate, which defaults to Guile’s equal? -procedure. By default, deletion preserves the order of the array, but -takes linear time in the worst case. If fast? is #t then -item will deleted in constant time, but order is not preserved. -

- -
-
Procedure: array-list-clear! array-list
-

Remove all items from array-list. -

- -
-
Procedure: array-list-for-each proc array-list
-

Apply proc with each item in array-list. -

- -
-
Procedure: array-list-fold proc init array-list
-

Apply proc to all items in array-list to build a result and -return that result. init is the initial result. If there are -no objects in the vicinity of rect, just init is returned. -

- -
-
-

-Next: , Up: Data Structures   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Audio-Files.html b/manuals/chickadee/Audio-Files.html deleted file mode 100644 index a4d7994..0000000 --- a/manuals/chickadee/Audio-Files.html +++ /dev/null @@ -1,221 +0,0 @@ - - - - - - -Audio Files (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Up: Audio   [Contents][Index]

-
-
-

5.4.1 Audio Files

- -

Sound data is represented by a special <audio> data type that -stores not only the audio samples themselves, but metadata such as -sample rate, number of channels, and how many bits are used for each -sample. -

-
-
Procedure: load-audio file-name [#:mode static]
-

Load audio within file-name. The following file formats are -currently supported: -

-
    -
  • WAV -
  • MP3 -
  • Ogg Vorbis -
- -

Audio files can be loaded in two different ways, as indicated by -mode: -

-
    -
  • static: -Load the entire audio file into memory. -
  • stream: -Load chunks of the audio file as needed. -
- -

Generally speaking, sound effects don’t take up much space and should -be loaded statically, but music files are much larger and should use -streaming. Static loading is the default. -

- -
-
Procedure: audio? obj
-

Return #t if obj is an audio object. -

- -
-
Procedure: streaming-audio? audio
-

Return #t if audio uses stream loading. -

- -
-
Procedure: static-audio?
-

Return #t if audio uses static loading. -

- -
-
Procedure: audio-mode audio
-

Return the loading mode for audio, either static or -stream. -

- -
-
Procedure: audio-duration audio
-

Return the duration of audio in seconds. -

- -
-
Procedure: audio-bits-per-sample audio
-

Return the number of bits per sample in audio. -

- -
-
Procedure: audio-channels audio
-

Return the number of channels in audio. -

- -
-
Procedure: audio-sample-rate audio
-

Return the sample rate of audio. -

- -
-
Procedure: audio-play audio [#:pitch 1.0] [#:volume 1.0] [#:min-volume 0.0] [#:max-volume 1.0] [#:max-distance] [#:reference-distance 0.0] [#:rolloff-factor 1.0] [#:cone-outer-volume 0.0] [#:cone-inner-angle 0.0] [#:cone-outer-angle] [#:position (vec3 0.0 0.0 0.0)] [#:velocity (vec3 0.0 0.0 0.0)] [#:direction (vec3 0.0 0.0 0.0)] [#:relative? #f]
-
-

Play audio. There are many, many knobs to tweak that will -affect the sound that comes out of the player’s speakers.: -

-
    -
  • pitch: -Pitch multiplier. The default value of 1.0 means no change in pitch. -
  • volume: -Volume multiplier. The default value of 1.0 means no change in volume. -
  • min-volume: -Minimum volume. -
  • max-volume: -Maximum volume. -
  • max-distance: -Used with the inverse clamped distance model (the default model) to -set the distance where there will no longer be any attenuation of the -source. -
  • reference-distance: -The distance where the volume for the audio would drop by half (before -being influenced by the rolloff factor or maximum distance.) -
  • rolloff-factor: -For slowing down or speeding up the rate of attenuation. The default -of 1.0 means no attenuation adjustment is made. -
  • cone-outer-volume: -The volume when outside the oriented cone. -
  • cone-inner-angle: -Inner angle of the sound cone, in radians. The default value is 0. -
  • cone-outer-angle: -Outer angle of the sound cone, in radians. The default value is 2pi -radians, or 360 degrees. -
  • position: -The source of the sound emitter in 3D space. -
  • velocity: -The velocity of the sound emitter in 3D space. -
  • direction: -The direction of the sound emitter in 3D space. -
  • relative?: -A flag that determines whether the position is in absolute coordinates -or relative to the listener’s location. Absolute coordinates are used -by default. -
- -

For games with basic sound needs (that is to say they don’t need 3D -sound modeling), the only things that really matter are volume -and pitch. -

-
- -
-
-

-Next: , Up: Audio   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Audio.html b/manuals/chickadee/Audio.html deleted file mode 100644 index 8f167d0..0000000 --- a/manuals/chickadee/Audio.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - -Audio (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: API Reference   [Contents][Index]

-
-
-

5.4 Audio

- -

A game isn’t complete without sound. Most games play some cool -background music to set the mood and have many sound effects to play -when events happen. The (chickadee audio) module provides a -robust audio API backed by the OpenAL 3D audio system. -

- - - - - - - -

The basics of playing audio are very simple. Just load an audio file -in the load hook (or anywhere else once the game loop is running) and -play it! -

-
-
(define sample (load-audio "neat-sound-effect.wav"))
-
-(audio-play sample)
-
- -

For more advanced usage, check out the full API reference in the -following sections. -

- - - - - diff --git a/manuals/chickadee/Basics.html b/manuals/chickadee/Basics.html deleted file mode 100644 index c968a8c..0000000 --- a/manuals/chickadee/Basics.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - -Basics (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Up: Math   [Contents][Index]

-
-
-

5.2.1 Basics

- -
-
Variable: pi
-

An essential constant for all trigonometry. Pi is the ratio of a -circle’s circumferences to its diameter. Since pi is an irrational -number, the pi in Chickadee is a mere floating point -approximation that is “good enough.” -

- -
-
Variable: pi/2
-

Half of pi. -

- -
-
Variable: tau
-

Twice pi. -

- -
-
Procedure: cotan z
-

Return the cotangent of z. -

- -
-
Procedure: clamp min max x
-

Restrict x to the inclusive range defined by min and -max. This procedure assumes that min is actually less -than max. -

- -
-
Procedure: lerp start end alpha
-

Linearly interpolate the numbers start and end using the -factor alpha, a number in the range [0, 1]. -

- -
-
Procedure: degrees->radians degrees
-

Convert degrees to radians. -

- -
-
Procedure: radians->degrees radians
-

Convert radians to degrees. -

- - - - - - diff --git a/manuals/chickadee/Bezier-Curves.html b/manuals/chickadee/Bezier-Curves.html deleted file mode 100644 index 8935b0f..0000000 --- a/manuals/chickadee/Bezier-Curves.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - -Bezier Curves (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Previous: , Up: Math   [Contents][Index]

-
-
-

5.2.7 Bezier Curves

- -

The (chickadee math bezier) module provides an API for -describing cubic Bezier curves in 2D space. These curves are notably -used in font description, vector graphics programs, and when it comes -to games: path building. With Bezier curves, it’s somewhat easy to -create a smooth looking path for an enemy to move along, for example. -Bezier curves become particularly interesting when they are chained -together to form a Bezier “path”, where the end point of one curve -becomes the starting point of the next. -

-
-
Procedure: make-bezier-curve p0 p1 p2 p3
-

Return a new Bezier curve object whose starting point is p0, -ending point is p3, and control points are p1 and -p2. All points are 2D vectors. -

- -
-
Procedure: bezier-curve? obj
-

Return #t if obj is a Bezier curve. -

- -
-
Procedure: bezier-curve-p0 bezier
-

Return the starting point of bezier. -

- -
-
Procedure: bezier-curve-p1 bezier
-

Return the first control point of bezier. -

- -
-
Procedure: bezier-curve-p2 bezier
-

Return the second control point of bezier. -

- -
-
Procedure: bezier-curve-p3 bezier
-

Return the end point of bezier. -

- -
-
Procedure: bezier-path . control-points
-

Return a list of connected bezier curves defined by -control-points. The first curve is defined by the first 4 -arguments and every additional curve thereafter requires 3 additional -arguments. -

- -
-
Procedure: bezier-curve-point-at bezier t
-

Return the coordinates for bezier at t (a value in the -range [0, 1] representing how far from the start of the curve to -check) as a 2D vector. -

- -
-
Procedure: bezier-curve-point-at! dest bezier t
-

Modify the 2D vector dest in-place to contain the coordinates -for bezier at t. -

- -
-
-

-Previous: , Up: Math   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Buffers.html b/manuals/chickadee/Buffers.html deleted file mode 100644 index ac5fb02..0000000 --- a/manuals/chickadee/Buffers.html +++ /dev/null @@ -1,482 +0,0 @@ - - - - - - -Buffers (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
-
-

5.3.12 Buffers

- -

Alright, let’s brush aside all of those pretty high level abstractions -and discuss what is going on under the hood. The GPU exists as a -discrete piece of hardware separate from the CPU. In order to make it -draw things, we must ship lots of data out of our memory space and -into the GPU. The (chickadee graphics buffer) module provides an -API for manipulating GPU buffers. -

-

In OpenGL terminology, a chunk of data allocated on the GPU is a -“vertex buffer object” or VBO. For example, here is a bytevector -that could be transformed into a GPU buffer that packs together vertex -position and texture coordinates: -

-
-
(use-modules (chickadee graphics buffer) (srfi srfi-4))
-(define data
-  (f32vector -8.0 -8.0 ; 2D vertex
-             0.0 0.0   ; 2D texture coordinate
-             8.0 -8.0  ; 2D vertex
-             1.0 0.0   ; 2D texture coordinate
-             8.0 8.0   ; 2D vertex
-             1.0 1.0   ; 2D texture coordinate
-             -8.0 8.0  ; 2D vertex
-             0.0 1.0)) ; 2D texture coordinate
-
- -

This data represents a textured 16x16 square centered on the -origin. To send this data to the GPU, the make-buffer procedure -is needed: -

-
-
(define buffer (make-buffer data #:stride 16))
-
- -

The #:stride keyword argument indicates how many bytes make up -each element of the buffer. In this case, there are 4 floats per -element: 2 for the vertex, and 2 for the texture coordinate. A 32-bit -float is 4 bytes in length, so the buffer’s stride is 16. -

-

Within a VBO, one or more “attributes”, as OpenGL calls them, may be -present. Attributes are subregions within the buffer that have a -particular data type. In this case, there are two attributes packed -into the buffer. To define vertex attributes, the -make-vertex-attribute procedure is needed: -

-
-
(define vertices
-  (make-vertex-attribute #:buffer buffer
-                         #:type 'vec2
-                         #:component-type 'float
-                         #:length 4))
-(define texcoords
-  (make-vertex-attribute #:buffer buffer
-                         #:type 'vec2
-                         #:component-type 'float
-                         #:length 4
-                         #:offset 8))
-
- -

To render a square, the GPU needs to draw two triangles, which means -we need 6 vertices in total. However, the above buffer only contains -data for 4 vertices. This is because there are only 4 unique vertices -for a square, but 2 of them must be repeated for each triangle. To -work with deduplicated vertex data, an “index buffer” must be -created. -

-
-
(define index-buffer
-  (make-buffer (u32vector 0 3 2 0 2 1)
-               #:target 'index)
-(define indices
-  (make-vertex-attribute #:type 'scalar
-                         #:component-type 'unsigned-int
-                         #:buffer index-buffer))
-
- -

Note the use of the #:target keyword argument. It is required -because the GPU treats index data in a special way and must be told -which data is index data. -

-

Now that the vertex attributes have been created, all that’s left is -to bind them all together in a vertex array. Vertex arrays associate -each vertex attribute with an attribute index on the GPU. The indices -that are chosen must correspond with the indices that the shader -(see Shaders) expects for each attribute. -

-
-
(define vertex-array
-  (make-vertex-array #:indices indices
-                     #:attributes `((0 . ,vertices)
-                                    (1 . ,texcoords))))
-
- -

With the vertex array created, the GPU is now fully aware of how to -interpret the data that it has been given in the original buffer. -Actually rendering this square is left as an exercise to the reader. -See the Shaders section and the shader-apply procedure in -Rendering Engine for the remaining pieces of a successful draw -call. Additionally, consider reading the source code for sprites, -shapes, or particles to see GPU buffers in action. -

-

Without further ado, the API reference: -

-
-
Procedure: make-buffer data [#:name "anonymous"] [#:length] [#:offset 0] [#:stride 0] [#:target vertex] [#:usage static]
-
-

Upload data, a bytevector, to the GPU. By default, the entire -bytevector is uploaded. A subset of the data may be uploaded by -specifying the offset, the index of the first byte to be -uploaded, and length, the number of bytes to upload. -

-

If data is #f, allocate length bytes of fresh GPU -memory instead. -

-

target and usage are hints that tell the GPU how the -buffer is intended to be used. -

-

target may be: -

-
    -
  • vertex -Vertex attribute data. - -
  • index -Index buffer data. - -
- -

usage may be: -

-
    -
  • static -The buffer data will not be modified after creation. - -
  • stream -The buffer data will be modified frequently. - -
- -

name is simply an arbitrary string for debugging purposes that -is never sent to the GPU. -

- -
-
Procedure: buffer? obj
-

Return #t if obj is a GPU buffer. -

- -
-
Procedure: index-buffer? buffer
-

Return #t if buffer is an index buffer. -

- -
-
Variable: null-buffer
-

Represents the absence of a buffer. -

- -
-
Procedure: buffer-name buffer
-

Return the name of buffer. -

- -
-
Procedure: buffer-length buffer
-

Return the length of buffer. -

- -
-
Procedure: buffer-stride buffer
-

Return the amount of space, in bytes, between each element in -buffer. -

- -
-
Procedure: buffer-target buffer
-

Return the the intended usage of buffer, either vertex or -index. -

- -
-
Procedure: buffer-usage buffer
-

Return the intended usage of buffer, either static for -buffer data that will not change once sent to the GPU, or -stream for buffer data that will be frequently updated from the -client-side. -

- -
-
Procedure: buffer-data buffer
-

Return a bytevector containing all the data within buffer. If -buffer has not been mapped (see with-mapped-buffer) then -this procedure will return #f. -

- -
-
Syntax: with-mapped-buffer buffer body …
-

Evaluate body in the context of buffer having its data -synced from GPU memory to RAM. In this context, buffer-data -will return a bytevector of all the data stored in buffer. When -program execution exits this form, the data (including any -modifications) is synced back to the GPU. -

-
-
Procedure: current-buffer
-

Return the current buffer. -

- -
-
Variable: g:buffer
-

Render state for buffers (see Rendering Engine.) -

- -

This form is useful for streaming buffers that need to update their -contents dynamically, such as a sprite batch. -

- -
-
Procedure: make-vertex-attribute #:buffer #:type #:component-type #:length [#:offset 0] [#:divisor 1] [#:name "anonymous"]
-
-

Return a new vertex attribute for buffer starting at byte index -offset of length elements, where each element is of -type and composed of component-type values. -

-

Valid values for type are: -

-
    -
  • scalar -single number - -
  • vec2 -2D vector - -
  • vec3 -3D vector - -
  • vec4 -4D vector - -
  • mat2 -2x2 matrix - -
  • mat3 -3x3 matrix - -
  • mat4 -4x4 matrix -
- -

Valid values for component-type are: -

-
    -
  • byte -
  • unsigned-byte -
  • short -
  • unsigned-short -
  • int -
  • unsigned-int -
  • float -
  • double - -
- -

divisor is only needed for instanced rendering applications (see -shader-apply/instanced in Rendering Engine) and represents -how many instances each vertex element applies to. A divisor of 0 -means that a single element is used for every instance and is used for -the data being instanced. A divisor of 1 means that each element is -used for 1 instance. A divisor of 2 means that each element is used -for 2 instances, and so on. -

- -
-
Procedure: vertex-attribute? obj
-

Return #t if obj is a vertex attribute. -

- -
-
Procedure: vertex-attribute->buffer vertex-attribute
-

Return the buffer that vertex-attribute is using. -

- -
-
Procedure: vertex-attribute-name vertex-attribute
-

Return the name of vertex-attribute. -

- -
-
Procedure: vertex-attribute-offset vertex-attribute
-

Return the byte offset of vertex-attribute. -

- -
-
Procedure: vertex-attribute-type vertex-attribute
-

Return the data type of vertex-attribute. -

- -
-
Procedure: vertex-attribute-component-type vertex-attribute
-

Return the component data type of vertex-attribute -

- -
-
Procedure: vertex-attribute-divisor vertex-attribute
-

Return the instance divisor for vertex-attribute. -

- -
-
Syntax: with-mapped-vertex-attribute vertex-attribute body …
-
-

Evaluate body in the context of vertex-attribute having -its data synced from GPU memory to RAM. See with-mapped-buffer -for more information. -

- -
-
Procedure: make-vertex-array #:indices #:attributes [#:mode triangles]
-
-

Return a new vertex array using the index data within the vertex -attributes indices and the vertex attribute data within -attributes. -

-

attributes is an alist mapping shader attribute indices to -vertex attributes: -

-
-
`((1 . ,vertex-attribute-a)
-  (2 . ,vertex-attribute-b)
-  ...)
-
- -

By default, the vertex array is interpreted as containing a series of -triangles. If another primtive type is desired, the mode -keyword argument may be overridden. The following values are -supported: -

-
    -
  • points -
  • lines -
  • line-loop -
  • line-strip -
  • triangles -
  • triangle-strip -
  • triangle-fan -
- -
- -
-
Variable: null-vertex-array
-

Represents the absence of a vertex array. -

- -
-
Procedure: vertex-array? obj
-

Return #t if obj is a vertex array. -

- -
-
Procedure: vertex-array-indices vertex-array
-

Return the buffer view containing index data for vertex-array. -

- -
-
Procedure: vertex-array-attributes vertex-array
-

Return the attribute index -> buffer view mapping of vertex attribute -data for vertex-array. -

- -
-
Procedure: vertex-array-mode vertex-array
-

Return the primitive rendering mode for vertex-array. -

- -
-
Procedure: current-vertex-array
-

Return the current vertex array. -

- -
-
Variable: g:vertex-array
-

Render state for vertex arrays (see Rendering Engine.) -

- -
-
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Channels.html b/manuals/chickadee/Channels.html deleted file mode 100644 index 78f8564..0000000 --- a/manuals/chickadee/Channels.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - -Channels (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Previous: , Up: Scripting   [Contents][Index]

-
-
-

5.5.4 Channels

- -

Channels are a tool for communicating amongst different scripts. One -script can write a value to the channel and another can read from it. -Reading or writing to a channel suspends that script until there is -someone on the other end of the line to complete the transaction. -

-

Here’s a simplistic example: -

-
-
(define c (make-channel))
-
-(script
- (forever
-  (let ((item (channel-get c)))
-    (pk 'got item))))
-
-(script
- (channel-put c 'sword)
- (channel-put c 'shield)
- (channel-put c 'potion))
-
- -
-
Procedure: make-channel
-

Return a new channel -

- -
-
Procedure: channel? obj
-

Return #t if obj is a channel. -

- -
-
Procedure: channel-get channel
-

Retrieve a value from channel. The current script suspends -until a value is available. -

- -
-
Procedure: channel-put channel data
-

Send data to channel. The current script suspends until -another script is available to retrieve the value. -

- -

A low-level API also exists for using channels outside of a script via -callback procedures: -

-
-
Procedure: channel-get! channel proc
-

Asynchronously retrieve a value from channel and call proc -with that value. -

- -
-
Procedure: channel-put! channel data [thunk]
-

Asynchronously send data to channel and call thunk -after it has been received. -

- -
-
Procedure: channel-clear! channel
-

Clear all messages and scripts awaiting messages in channel. -

- - - - - - diff --git a/manuals/chickadee/Colors.html b/manuals/chickadee/Colors.html deleted file mode 100644 index 4a361b1..0000000 --- a/manuals/chickadee/Colors.html +++ /dev/null @@ -1,377 +0,0 @@ - - - - - - -Colors (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Up: Graphics   [Contents][Index]

-
-
-

5.3.1 Colors

- -

Merriam-Webster defines color as “a phenomenon of light (such as red, -brown, pink, or gray) or visual perception that enables one to -differentiate otherwise identical objects.” In this essay, I -will… -

-

Okay, okay. We all know what colors are. Chickadee provides a data -type to represent color and some convenient procedures to work with -them in the (chickadee graphics color) module. Colors are made -up of four components, or channels: red, green, blue, and alpha -(transparency.) Each of these values is expressed as a uniform -floating point value in the range [0, 1]. 0 means that color channel -is unrepresented in the resulting color, whereas 1 means that color -channel is at full intensity. -

-

Making a color object is easy, and there’s a few ways to do it -depending on what’s most convenient. The first is make-color, -where you specify each channel exactly as described above. This is -fully opaque magenta: -

-
-
(make-color 1.0 0.0 1.0 1.0)
-
- -

Many people are used to representing colors as 6 or 8 digit -hexadecimal numbers, so Chickadee also allows that. Here’s magenta, -again: -

-
-
(rgba #xFF00FFFF)
-(rgb #xFF00FF) ; equivalent to the above
-
- -
-
Procedure: make-color r g b a
-

Return a new color object with a red value of r, a green value -of g, a blue value of b, and an alpha (transparency) value -of a. All values are clamped to the range [0, 1]. -

- -
-
Procedure: rgba color-code
-

Return a new color object using the values of the first 32 bits of -color-code. Each channel occupies 8 bits. Starting from the -most significant bit, red is first, followed by green, then blue, then -alpha. Color codes are often represented as 6 or 8 digit hexadecimal -numbers in various other programs. -

- -
-
Procedure: rgb color-code
-

Like rgba, but color-code is a 24 bit code with no alpha -channel. -

- -
-
Procedure: color? obj
-

Return #t if obj is a color object. -

- -
-
Procedure: color-r color
-

Return the red channel of color. -

- -
-
Procedure: color-g color
-

Return the green channel of color. -

- -
-
Procedure: color-b color
-

Return the blue channel of color. -

- -
-
Procedure: color-a color
-

Return the alpha channel of color. -

- -
-
Procedure: transparency alpha
-

Return a new color that is white (RGB channels set to 1) with an alpha -channel value of alpha. This can be useful for creating a color -that can be multiplied against another color to make it more -transparent. -

- -
-
Procedure: string->color s
-

Convert the hexadecimal color code in the string s to a color -object. The following string formats are supported: -

-
-
(string->color "#FF00FFFF")
-(string->color "FF00FFFF")
-(string->color "#FF00FF")
-(string->color "FF00FF")
-
- -
- -
-
Procedure: color* a b
-

Multiply the color a with the color or number b and return -a new color with the result. -

- -
-
Procedure: color+ a b
-

Add the color a to the color b and return a new color with -the result. -

- -
-
Procedure: color- a b
-

Subtract the color b from the color a and return a new -color with the result. -

- -
-
Procedure: color-inverse color
-

Invert the red, green, and blue channels of color and return a -new color with the result. -

- -
-
Procedure: color-lerp start end alpha
-

Linearly interpolate the colors start and end using the -factor alpha, a number in the range [0, 1]. -

- -

5.3.1.1 Stock Colors

- -

For convenience, Chickadee comes with some basic colors predefined: -

-
-
Variable: white
-
- -
-
Variable: black
-
- -
-
Variable: red
-
- -
-
Variable: green
-
- -
-
Variable: blue
-
- -
-
Variable: yellow
-
- -
-
Variable: magenta
-
- -
-
Variable: cyan
-
- -

For fun, there are also predefined colors for the classic -Tango color palette. -

-
-
Variable: tango-light-butter
-
- -
-
Variable: tango-butter
-
- -
-
Variable: tango-dark-butter
-
- -
-
Variable: tango-light-orange
-
- -
-
Variable: tango-orange
-
- -
-
Variable: tango-dark-orange
-
- -
-
Variable: tango-light-chocolate
-
- -
-
Variable: tango-chocolate
-
- -
-
Variable: tango-dark-chocolate
-
- -
-
Variable: tango-light-chameleon
-
- -
-
Variable: tango-chameleon
-
- -
-
Variable: tango-dark-chameleon
-
- -
-
Variable: tango-light-sky-blue
-
- -
-
Variable: tango-sky-blue
-
- -
-
Variable: tango-dark-sky-blue
-
- -
-
Variable: tango-light-plum
-
- -
-
Variable: tango-plum
-
- -
-
Variable: tango-dark-plum
-
- -
-
Variable: tango-light-scarlet-red
-
- -
-
Variable: tango-scarlet-red
-
- -
-
Variable: tango-dark-scarlet-red
-
- -
-
Variable: tango-aluminium-1
-
- -
-
Variable: tango-aluminium-2
-
- -
-
Variable: tango-aluminium-3
-
- -
-
Variable: tango-aluminium-4
-
- -
-
Variable: tango-aluminium-5
-
- -
-
Variable: tango-aluminium-6
-
- -
-
-

-Next: , Up: Graphics   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Command-Line-Interface.html b/manuals/chickadee/Command-Line-Interface.html deleted file mode 100644 index 01d2e90..0000000 --- a/manuals/chickadee/Command-Line-Interface.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - -Command Line Interface (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Top   [Contents][Index]

-
-
-

3 Command Line Interface

- -

While Chickadee is a library at heart, it also comes with a command -line utility to make it easier to get started. -

- - - - - - - - - - diff --git a/manuals/chickadee/Copying-This-Manual.html b/manuals/chickadee/Copying-This-Manual.html deleted file mode 100644 index 9fd7c29..0000000 --- a/manuals/chickadee/Copying-This-Manual.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - -Copying This Manual (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Top   [Contents][Index]

-
-
-

Appendix A Copying This Manual

- - - - - - - - - - diff --git a/manuals/chickadee/Data-Structures.html b/manuals/chickadee/Data-Structures.html deleted file mode 100644 index d268bf3..0000000 --- a/manuals/chickadee/Data-Structures.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - -Data Structures (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Previous: , Up: API Reference   [Contents][Index]

-
-
-

5.6 Data Structures

- - - - - - - - - - - - - - - diff --git a/manuals/chickadee/Easings.html b/manuals/chickadee/Easings.html deleted file mode 100644 index 67aba95..0000000 --- a/manuals/chickadee/Easings.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - -Easings (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Math   [Contents][Index]

-
-
-

5.2.6 Easings

- -

Easing functions are essential for animation. Each easing function -provides a different path to go from an initial value to a final -value. These functions make an excellent companion to the -tween procedure (see Tweening). Experiment with them to -figure out which function makes an animation look the best. -

-

Pro tip: smoothstep provides nice results most of the time and -creates smoother animation than using linear. -

-
-
Procedure: linear t
-
- -
-
Procedure: smoothstep t
-
- -
-
Procedure: ease-in-quad t
-
- -
-
Procedure: ease-out-quad t
-
- -
-
Procedure: ease-in-out-quad t
-
- -
-
Procedure: ease-in-cubic t
-
- -
-
Procedure: ease-out-cubic t
-
- -
-
Procedure: ease-in-out-cubic t
-
- -
-
Procedure: ease-in-quart t
-
- -
-
Procedure: ease-out-quart t
-
- -
-
Procedure: ease-in-out-quart t
-
- -
-
Procedure: ease-in-quint t
-
- -
-
Procedure: ease-out-quint t
-
- -
-
Procedure: ease-in-out-quint t
-
- -
-
Procedure: ease-in-sine t
-
- -
-
Procedure: ease-out-sine t
-
- -
-
Procedure: ease-in-out-sine t
-
- - - - - - diff --git a/manuals/chickadee/Fonts.html b/manuals/chickadee/Fonts.html deleted file mode 100644 index 9383789..0000000 --- a/manuals/chickadee/Fonts.html +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - -Fonts (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
-
-

5.3.4 Fonts

- -

Printing text to the screen is quite easy: -

-
-
(draw-text "Hello, world" (vec2 100.0 100.0))
-
- -

Chickadee supports OpenType/TrueType fonts (via the FreeType library), -bitmap fonts in Angel Code bmfont format, and simple sprite sheet -bitmap fonts. A default font named Inconsolata is used for all text -rendering operations where a font is not specified, as is the case in -the above example. -

-

The following procedures can be found in the (chickadee graphics -text) module: -

-
-
Procedure: load-font file-name point-size [#:char-set] [#:smooth? #t]
-

Load the scalable (OpenType, TrueType, etc.) font in the file -file-name and display it at the given point-size. By -default, all the characters in the ASCII character set are loaded. -This can be changed by passing a different character set -(see Character Sets in GNU Guile Reference Manual) using -the char-set keyword argument. -

-

If smooth? is #t (the default), text rendered with this -font will have a smoother appearance when text is rotated or scaled, -otherwise non-smooth scaling will be used. -

- -
-
Procedure: load-bitmap-font file
-

Load the Angel Code font (in either XML or FNT format) in file -and return a new font object. -

- -
-
Procedure: font? obj
-

Return #t if obj is a font object. -

- -
-
Procedure: font-face font
-

Return the name of font. -

- -
-
Procedure: font-line-height font
-

Return the line height of font. -

- -
-
Procedure: font-line-height font
-

Return the line height of font. -

- -
-
Procedure: font-bold? font
-

Return #t if font is a bold font. -

- -
-
Procedure: font-italic? font
-

Return #t if font is an italicized font. -

- -
-
Procedure: draw-text text position
-

[#:font] [#:color] [#:origin] [#:scale] [#:rotation] [#:blend-mode] - [#:start 0] [#:end (string-length text)] -

-

Draw the string text with the first character starting at -position using font. If font is not specified, a -built-in font is used. -

-
-
(draw-text "Hello, world!" (vec2 128.0 128.0))
-
- -

To render a substring of text, use the start and end -arguments. -

-

Refer to draw-sprite (see Sprites) for information about -the other arguments. -

- -
-
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Framebuffers.html b/manuals/chickadee/Framebuffers.html deleted file mode 100644 index 6560323..0000000 --- a/manuals/chickadee/Framebuffers.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - -Framebuffers (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
-
-

5.3.14 Framebuffers

- -

A framebuffer is a chunk of memory that the GPU can render things -onto. By default, the framebuffer that is used for rendering is the -one belonging to the game window, but custom framebuffers can be used -as well. A common use-case for custom framebuffers is applying -post-processing effects: The entire scene is rendered to a -framebuffer, and then the contents of that framebuffer are applied to -a post-processing shader and rendered to the game window. The -post-processing shader could do any number of things: scaling, -antialiasing, motion blur, etc. -

-
-
Procedure: make-framebuffer width height [#:min-filter linear] [#:mag-filter linear] [#:wrap-s repeat] [#:wrap-t repeat]
-
-

Create a new framebuffer that is width pixels wide and height pixels high. -

-

min-filter and mag-filter determine the scaling algorithm -applied to the framebuffer when rendering. By default, linear scaling -is used in both cases. To perform no smoothing at all, use -nearest for simple nearest neighbor scaling. This is typically -the best choice for pixel art games. -

- -
-
Procedure: framebuffer? obj
-

Return #t if obj is a framebuffer. -

- -
-
Procedure: framebuffer-texture fb
-

Return the texture backing the framebuffer fb. -

- -
-
Procedure: framebuffer-viewport fb
-

Return the default viewport (see Viewports) used by the -framebuffer fb. -

- -
-
Procedure: null-framebuffer
-

The default framebuffer. -

- -
-
Procedure: current-framebuffer
-

Return the current framebuffer. -

- -
-
Variable: g:framebuffer
-

Render state for framebuffers (see Rendering Engine.) -

- - - - - - diff --git a/manuals/chickadee/Getting-Started.html b/manuals/chickadee/Getting-Started.html deleted file mode 100644 index e7d695d..0000000 --- a/manuals/chickadee/Getting-Started.html +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - -Getting Started (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Top   [Contents][Index]

-
-
-

2 Getting Started

- -

One of the simplest programs we can make with Chickadee is rendering -the text “Hello, world” on screen. Here’s what that looks like: -

-
-
(define (draw alpha)
-  (draw-text "Hello, world!" (vec2 64.0 240.0)))
-
- -

The draw procedure is called frequently to draw the game scene. -For the sake of simplicity, we will ignore the alpha variable -in this tutorial. -

-

To run this program, we’ll use the chickadee play command: -

-
-
chickadee play hello.scm
-
- -

This is a good start, but it’s boring. Let’s make the text move! -

-
-
(define position (vec2 0.0 240.0))
-
-(define (draw alpha)
-  (draw-text "Hello, world!" position))
-
-(define (update dt)
-  (set-vec2-x! position (+ (vec2-x position) (* 100.0 dt))))
-
- -

The vec2 type is used to store 2D coordinates -(see Vectors.) A variable named position contains the -position where the text should be rendered. A new hook called -update has been added to handle the animation. This hook is -called frequently to update the state of the game. The variable -dt (short for “delta-time”) contains the amount of time that -has passed since the last update, in seconds. Putting it all -together, this update procedure is incrementing the x coordinate of -the position by 100 pixels per second. -

-

This is neat, but after a few seconds the text moves off the screen -completely, never to be seen again. It would be better if the text -bounced back and forth against the sides of the window. -

-
-
(define position (vec2 0.0 240.0))
-
-(define (draw alpha)
-  (draw-text "Hello, world!" position))
-
-(define (update dt)
-  (update-agenda dt))
-
-(define (update-x x)
-  (set-vec2-x! position x))
-
-(let ((start 0.0)
-      (end 536.0)
-      (duration 4.0))
-  (script
-   (while #t
-    (tween duration start end update-x)
-    (tween duration end start update-x))))
-
- -

This final example uses Chickadee’s scripting features -(see Scripting) to bounce the text between the edges of the window -indefinitely using the handy tween procedure. The only thing -the update procedure needs to do now is advance the clock of -the “agenda” (the thing that runs scripts.) The script takes care -of the rest. -

-

This quick tutorial has hopefully given you a taste of what you can do -with Chickadee. The rest of this manual gets into all of the details -that were glossed over, and much more. Try rendering a sprite, -playing a sound effect, or handling keyboard input. But most -importantly: Have fun! -

-
-
-

-Next: , Previous: , Up: Top   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Graphics.html b/manuals/chickadee/Graphics.html deleted file mode 100644 index e8b409b..0000000 --- a/manuals/chickadee/Graphics.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - -Graphics (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: API Reference   [Contents][Index]

-
-
-

5.3 Graphics

- -

Chickadee aims to make hardware-accelerated graphics rendering as -simple and efficient as possible by providing high-level APIs that -interact with the low-level OpenGL API under the hood. Anyone that -has worked with OpenGL directly knows that it has a steep learning -curve and a lot of effort is needed to render even a single triangle. -The Chickadee rendering engine attempts to make it easy to do common -tasks like rendering a sprite while also providing all of the building -blocks to implement additional rendering techniques. -

- - - - - - - - - - - - - - - - - - - - -
-
-

-Next: , Previous: , Up: API Reference   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Grids.html b/manuals/chickadee/Grids.html deleted file mode 100644 index e8ec2b6..0000000 --- a/manuals/chickadee/Grids.html +++ /dev/null @@ -1,214 +0,0 @@ - - - - - - -Grids (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Data Structures   [Contents][Index]

-
-
-

5.6.5 Grids

- -

The (chickadee data grid) module provides a simple spatial -partitioning system for axis-aligned bounding boxes -(see Rectangles) in 2D space. The grid divides the world into -tiles and keeps track of which rectangles occupy which tiles. When -there are lots of moving objects in the game world that need collision -detection, the grid greatly speeds up the process. Instead of -checking collisions of each object against every other object (an -O(n^2) operation), the grid quickly narrows down which objects could -possibly be colliding and only performs collision testing against a -small set of objects. -

-

In addition to checking for collisions, the grid also handles the -resolution of collisions. Exactly how each collision is resolved is -user-defined. A player bumping into a wall may slide against it. An -enemy colliding with a projectile shot by the player may get pushed -back in the opposite direction. Two players colliding may not need -resolution at all and will just pass through each other. The way this -works is that each time an object (A) is moved within the grid, the -grid looks for an object (B) that may possibly be colliding with A. A -user-defined procedure known as a “filter” is then called with both -A and B. If the filter returns #f, it means that even if A and -B are colliding, no collision resolution is needed. In this case the -grid won’t waste time checking if they really do collide because it -doesn’t matter. If A and B are collidable, then the filter returns a -procedure that implements the resolution technique. The grid will -then perform a collision test. If A and B are colliding, the resolver -procedure is called. It’s the resolvers job to adjust the objects -such that they are no longer colliding. The grid module comes with a -very simple resolution procedure, slide, that adjusts object A -by the smallest amount so that it no longer overlaps with B. By using -this filtering technique, a game can resolve collisions between -different objects in different ways. -

-
-
Procedure: make-grid [cell-size 64]
-

Return a new grid partitioned into cell-size tiles. -

- -
-
Procedure: grid? obj
-

Return #t if obj is a grid. -

- -
-
Procedure: cell? obj
-

Return #t if obj is a grid cell. -

- -
-
Procedure: cell-count cell
-

Return the number of items in cell. -

- -
-
Procedure: grid-cell-size grid
-

Return the cell size of grid. -

- -
-
Procedure: grid-cell-count grid
-

Return the number of cells currently in grid. -

- -
-
Procedure: grid-item-count grid
-

Return the number of items in grid. -

- -
-
Procedure: grid-add grid item x y width height
-
-

Add item to grid represented by the axis-aligned bounding -box whose lower-left corner is at (x, y) and is -width x height in size. -

- -
-
Procedure: grid-remove grid item
-

Return item from grid. -

- -
-
Procedure: grid-clear grid
-

Remove all items from grid. -

- -
-
Procedure: grid-move grid item position filter
-

Attempt to move item in grid to position (a 2D -vector) and check for collisions. For each collision, filter -will be called with two arguments: item and the item it collided -with. If a collision occurs, position may be modified to -resolve the colliding objects. -

- -
-
Procedure: for-each-cell proc grid [rect]
-

Call proc with each cell in grid that intersects -rect, or every cell if rect is #f. -

- -
-
Procedure: for-each-item proc grid
-

Call proc for each item in grid. -

- -
-
Procedure: slide item item-rect other other-rect goal
-
-

Resolve the collision that occurs between item and other -when moving item-rect to goal by sliding item-rect -the minimum amount needed to make it no longer overlap -other-rect. -

- -
-
-

-Next: , Previous: , Up: Data Structures   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Heaps.html b/manuals/chickadee/Heaps.html deleted file mode 100644 index effdb89..0000000 --- a/manuals/chickadee/Heaps.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - -Heaps (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Data Structures   [Contents][Index]

-
-
-

5.6.3 Heaps

- -

The (chickadee data heap) module provides a binary heap data -structure. The heap orders data from smallest to largest, according -to a custom comparison predicate, making it a good choice for priority -queues. -

-
-
Procedure: make-heap [#:< <]
-

Return a new heap that uses the predicate < to determine order. -

- -
-
Procedure: heap? obj
-

Return #t if obj is a heap. -

- -
-
Procedure: heap-empty? heap
-

Return #t if heap is empty. -

- -
-
Procedure: heap-size heap
-

Return the current size of heap. -

- -
-
Procedure: heap-min heap
-

Return the minimum item in heap. -

- -
-
Procedure: heap-insert! heap item
-

Add item to heap. -

- -
-
Procedure: heap-remove! heap
-

Remove the minimum item in heap. -

- -
-
Procedure: heap-clear! heap
-

Remove all items from heap. -

- - - - - - diff --git a/manuals/chickadee/Index.html b/manuals/chickadee/Index.html deleted file mode 100644 index 4d64ac2..0000000 --- a/manuals/chickadee/Index.html +++ /dev/null @@ -1,1034 +0,0 @@ - - - - - - -Index (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - -
-

-Previous: , Up: Top   [Contents][Index]

-
-
-

Index

- -
Jump to:   % -   -
-A -   -B -   -C -   -D -   -E -   -F -   -G -   -H -   -I -   -J -   -K -   -L -   -M -   -N -   -O -   -P -   -Q -   -R -   -S -   -T -   -U -   -V -   -W -   -Y -   -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Index Entry  Section

%
%default-config: Invoking chickadee bundle

A
a*: Path Finding
abort-game: The Game Loop
add-particle-emitter: Particles
after: Agendas
agenda-time: Agendas
agenda?: Agendas
animation-duration: Tile Maps
animation-frame-duration: Tile Maps
animation-frame-tile: Tile Maps
animation-frame?: Tile Maps
animation-frames: Tile Maps
animation?: Tile Maps
arc: Vector Paths
arc-to: Vector Paths
array-list: Array Lists
array-list-clear!: Array Lists
array-list-delete!: Array Lists
array-list-empty?: Array Lists
array-list-fold: Array Lists
array-list-for-each: Array Lists
array-list-pop!: Array Lists
array-list-push!: Array Lists
array-list-ref: Array Lists
array-list-set!: Array Lists
array-list-size: Array Lists
array-list?: Array Lists
at: Agendas
attribute-location: Shaders
attribute-name: Shaders
attribute-type: Shaders
attribute?: Shaders
audio-bits-per-sample: Audio Files
audio-channels: Audio Files
audio-duration: Audio Files
audio-mode: Audio Files
audio-play: Audio Files
audio-sample-rate: Audio Files
audio?: Audio Files

B
back-cull-face-mode: Render Settings
below: Vector Paths
beside: Vector Paths
bezier-curve-p0: Bezier Curves
bezier-curve-p1: Bezier Curves
bezier-curve-p2: Bezier Curves
bezier-curve-p3: Bezier Curves
bezier-curve-point-at: Bezier Curves
bezier-curve-point-at!: Bezier Curves
bezier-curve?: Bezier Curves
bezier-path: Bezier Curves
bezier-path: Vector Paths
bezier-to: Vector Paths
black: Colors
blend:add: Render Settings
blend:alpha: Render Settings
blend:darken: Render Settings
blend:lighten: Render Settings
blend:multiply: Render Settings
blend:replace: Render Settings
blend:screen: Render Settings
blend:subtract: Render Settings
blue: Colors
bool: Shaders
buffer-data: Buffers
buffer-length: Buffers
buffer-name: Buffers
buffer-stride: Buffers
buffer-target: Buffers
buffer-usage: Buffers
buffer?: Buffers

C
call-when: Agendas
cancel-script: Scripts
canvas?: Vector Paths
cell-count: Grids
cell?: Grids
channel-clear!: Channels
channel-get: Channels
channel-get!: Channels
channel-put: Channels
channel-put!: Channels
channel?: Channels
circle: Vector Paths
clamp: Basics
close-path: Vector Paths
color*: Colors
color+: Colors
color-: Colors
color-a: Colors
color-b: Colors
color-g: Colors
color-inverse: Colors
color-lerp: Colors
color-r: Colors
color?: Colors
controller-axis: Input Devices
controller-button-pressed?: Input Devices
controller-button-released?: Input Devices
controller-name: Input Devices
corner-split: Vector Paths
cotan: Basics
cube-map?: Textures
cull-face-mode-back?: Render Settings
cull-face-mode-front?: Render Settings
cull-face-mode?: Render Settings
current-agenda: Agendas
current-agenda: Agendas
current-buffer: Buffers
current-cull-face-mode: Render Settings
current-depth-test: Render Settings
current-framebuffer: Framebuffers
current-multisample: Render Settings
current-polygon-mode: Render Settings
current-projection: Rendering Engine
current-stencil-test: Render Settings
current-texture-0: Textures
current-texture-1: Textures
current-texture-2: Textures
current-texture-3: Textures
current-texture-4: Textures
current-vertex-array: Buffers
current-viewport: Viewports
current-window: Window Manipulation
cyan: Colors

D
default-stencil-test: Render Settings
define-shader-type: Shaders
degrees->radians: Basics
depth-test-far: Render Settings
depth-test-function: Render Settings
depth-test-near: Render Settings
depth-test-write?: Render Settings
depth-test?: Render Settings
dequeue!: Queues
directional-light?: Lights
distance-model: The Environment
doppler-factor: The Environment
draw-9-patch: Sprites
draw-canvas: Vector Paths
draw-model: Models
draw-particles: Particles
draw-particles*: Particles
draw-skybox: Skyboxes
draw-sprite: Sprites
draw-sprite-batch: Sprites
draw-text: Fonts
draw-tile-map: Tile Maps

E
ease-in-cubic: Easings
ease-in-out-cubic: Easings
ease-in-out-quad: Easings
ease-in-out-quart: Easings
ease-in-out-quint: Easings
ease-in-out-sine: Easings
ease-in-quad: Easings
ease-in-quart: Easings
ease-in-quint: Easings
ease-in-sine: Easings
ease-out-cubic: Easings
ease-out-quad: Easings
ease-out-quart: Easings
ease-out-quint: Easings
ease-out-sine: Easings
elapsed-time: The Game Loop
ellipse: Vector Paths
enqueue!: Queues
every: Agendas
every: Agendas

F
fill: Vector Paths
fill-and-stroke: Vector Paths
fill-polygon-mode: Render Settings
float: Shaders
float-vec2: Shaders
float-vec3: Shaders
float-vec4: Shaders
font-bold?: Fonts
font-face: Fonts
font-italic?: Fonts
font-line-height: Fonts
font-line-height: Fonts
font?: Fonts
for-each-cell: Grids
for-each-item: Grids
forever: Scripts
framebuffer-texture: Framebuffers
framebuffer-viewport: Framebuffers
framebuffer?: Framebuffers
front-and-back-cull-face-mode: Render Settings
front-cull-face-mode: Render Settings

G
g:buffer: Buffers
g:cull-face-mode: Render Settings
g:depth-test: Render Settings
g:framebuffer: Framebuffers
g:multisample?: Render Settings
g:polygon-mode: Render Settings
g:stencil-test: Render Settings
g:texture-0: Textures
g:texture-1: Textures
g:texture-2: Textures
g:texture-3: Textures
g:texture-4: Textures
g:vertex-array: Buffers
g:viewport: Viewports
gradient?: Vector Paths
green: Colors
grid-add: Grids
grid-cell-count: Grids
grid-cell-size: Grids
grid-clear: Grids
grid-item-count: Grids
grid-move: Grids
grid-remove: Grids
grid?: Grids

H
heap-clear!: Heaps
heap-empty?: Heaps
heap-insert!: Heaps
heap-min: Heaps
heap-remove!: Heaps
heap-size: Heaps
heap?: Heaps
hide-window!: Window Manipulation
horizontal-flip: Vector Paths

I
index-buffer?: Buffers
int: Shaders

J
join: Scripts

K
key-pressed?: Input Devices
key-released?: Input Devices

L
lerp: Basics
light-color: Lights
light-cut-off: Lights
light-direction: Lights
light-intensity: Lights
light-position: Lights
light-type: Lights
line: Vector Paths
line-polygon-mode: Render Settings
line-to: Vector Paths
linear: Easings
linear-gradient: Vector Paths
listener-orientation: The Listener
listener-position: The Listener
listener-velocity: The Listener
listener-volume: The Listener
load-audio: Audio Files
load-bitmap-font: Fonts
load-cube-map: Textures
load-font: Fonts
load-gltf: Models
load-image: Textures
load-obj: Models
load-shader: Shaders
load-tile-map: Tile Maps
load-tileset: Textures
local-field: Shaders

M
magenta: Colors
make-agenda: Agendas
make-array-list: Array Lists
make-bezier-curve: Bezier Curves
make-blend-mode: Render Settings
make-buffer: Buffers
make-canvas: Vector Paths
make-channel: Channels
make-color: Colors
make-cube: Meshes
make-depth-test: Render Settings
make-directional-light: Lights
make-empty-canvas: Vector Paths
make-framebuffer: Framebuffers
make-grid: Grids
make-heap: Heaps
make-identity-matrix3: Matrices
make-identity-matrix4: Matrices
make-identity-quaternion: Quaternions
make-matrix3: Matrices
make-matrix4: Matrices
make-mesh: Meshes
make-null-matrix3: Matrices
make-null-matrix4: Matrices
make-particle-emitter: Particles
make-particles: Particles
make-path-finder: Path Finding
make-pbr-material: Meshes
make-pbr-properties: Meshes
make-phong-material: Meshes
make-phong-properties: Meshes
make-plane: Meshes
make-point-light: Lights
make-polygon-mode: Render Settings
make-primitive: Meshes
make-quadtree: Quadtrees
make-queue: Queues
make-rect: Rectangles
make-shader: Shaders
make-skybox: Skyboxes
make-source: Sources
make-sphere: Meshes
make-spot-light: Lights
make-sprite-batch: Sprites
make-stencil-test: Render Settings
make-tesselated-plane: Meshes
make-vertex-array: Buffers
make-vertex-attribute: Buffers
make-viewport: Viewports
map-object-id: Tile Maps
map-object-name: Tile Maps
map-object-properties: Tile Maps
map-object-shape: Tile Maps
map-object-type: Tile Maps
map-object?: Tile Maps
mat3: Shaders
mat4: Shaders
material-blend-mode: Meshes
material-cull-face-mode: Meshes
material-depth-test: Meshes
material-multisample?: Meshes
material-name: Meshes
material-polygon-mode: Meshes
material-properties: Meshes
material-shader: Meshes
material-stencil-test: Meshes
material-texture-0: Meshes
material-texture-1: Meshes
material-texture-2: Meshes
material-texture-3: Meshes
material-texture-4: Meshes
material?: Meshes
matrix3*: Matrices
matrix3-copy: Matrices
matrix3-copy!: Matrices
matrix3-identity!: Matrices
matrix3-inverse: Matrices
matrix3-inverse!: Matrices
matrix3-mult!: Matrices
matrix3-rotate: Matrices
matrix3-rotate!: Matrices
matrix3-scale: Matrices
matrix3-scale!: Matrices
matrix3-transform: Matrices
matrix3-transform!: Matrices
matrix3-translate: Matrices
matrix3-translate!: Matrices
matrix3=: Matrices
matrix3?: Matrices
matrix4*: Matrices
matrix4-2d-transform!: Matrices
matrix4-copy: Matrices
matrix4-copy!: Matrices
matrix4-identity!: Matrices
matrix4-inverse: Matrices
matrix4-inverse!: Matrices
matrix4-mult!: Matrices
matrix4-rotate: Matrices
matrix4-rotate!: Matrices
matrix4-rotate-z: Matrices
matrix4-rotate-z!: Matrices
matrix4-scale: Matrices
matrix4-scale!: Matrices
matrix4-transform!: Matrices
matrix4-translate: Matrices
matrix4-translate!: Matrices
matrix4=: Matrices
matrix4?: Matrices
maximize-window!: Window Manipulation
mesh-name: Meshes
mesh-primitives: Meshes
mesh?: Meshes
minimize-window!: Window Manipulation
model?: Models
mouse-button-pressed?: Input Devices
mouse-button-released?: Input Devices
mouse-x: Input Devices
mouse-y: Input Devices
move-to: Vector Paths

N
no-cull-face-mode: Render Settings
null-buffer: Buffers
null-framebuffer: Framebuffers
null-shader: Shaders
null-vertex-array: Buffers

O
object-layer-name: Tile Maps
object-layer-objects: Tile Maps
object-layer-properties: Tile Maps
object-layer?: Tile Maps
orthographic-projection: Matrices

P
pad: Vector Paths
particle-emitter-done?: Particles
particle-emitter-life: Particles
particle-emitter-rate: Particles
particle-emitter-spawn-area: Particles
particle-emitter?: Particles
particles?: Particles
path: Vector Paths
path-finder?: Path Finding
pbr-properties-alpha-cutoff: Meshes
pbr-properties-alpha-mode: Meshes
pbr-properties-base-color-factor: Meshes
pbr-properties-base-color-texcoord: Meshes
pbr-properties-emissive-factor: Meshes
pbr-properties-emissive-texcoord: Meshes
pbr-properties-metallic-factor: Meshes
pbr-properties-metallic-roughness-texcoord: Meshes
pbr-properties-normal-texcoord: Meshes
pbr-properties-occlusion-texcoord: Meshes
pbr-properties-roughness: Meshes
pbr-properties?: Meshes
perspective-projection: Matrices
phong-properties-ambient: Meshes
phong-properties-diffuse: Meshes
phong-properties-shininess: Meshes
phong-properties-specular: Meshes
phong-properties?: Meshes
pi: Basics
pi/2: Basics
point->tile: Tile Maps
point-light?: Lights
point-polygon-mode: Render Settings
polygon-mode?: Render Settings
polygon-points: Tile Maps
polygon?: Tile Maps
polyline: Vector Paths
primitive-material: Meshes
primitive-name: Meshes
primitive-vertex-array: Meshes
primitive?: Meshes

Q
quadtree-bounds: Quadtrees
quadtree-clear!: Quadtrees
quadtree-delete!: Quadtrees
quadtree-depth: Quadtrees
quadtree-find: Quadtrees
quadtree-fold: Quadtrees
quadtree-for-each: Quadtrees
quadtree-insert!: Quadtrees
quadtree-leaf?: Quadtrees
quadtree-max-depth: Quadtrees
quadtree-max-size: Quadtrees
quadtree-q1: Quadtrees
quadtree-q2: Quadtrees
quadtree-q3: Quadtrees
quadtree-q4: Quadtrees
quadtree-size: Quadtrees
quadtree?: Quadtrees
quaternion: Quaternions
quaternion-w: Quaternions
quaternion-x: Quaternions
quaternion-y: Quaternions
quaternion-z: Quaternions
quaternion?: Quaternions
queue-clear!: Queues
queue-empty?: Queues
queue-length: Queues
queue?: Queues

R
radial-gradient: Vector Paths
radians->degrees: Basics
raise-window!: Window Manipulation
rect: Rectangles
rect-area: Rectangles
rect-bottom: Rectangles
rect-center-x: Rectangles
rect-center-y: Rectangles
rect-clamp: Rectangles
rect-clamp!: Rectangles
rect-clamp-x: Rectangles
rect-clamp-y: Rectangles
rect-clip: Rectangles
rect-clip!: Rectangles
rect-contains-vec2?: Rectangles
rect-contains?: Rectangles
rect-height: Rectangles
rect-inflate: Rectangles
rect-inflate!: Rectangles
rect-intersects?: Rectangles
rect-left: Rectangles
rect-move: Rectangles
rect-move!: Rectangles
rect-move-by: Rectangles
rect-move-by!: Rectangles
rect-move-by-vec2: Rectangles
rect-move-by-vec2!: Rectangles
rect-move-vec2: Rectangles
rect-move-vec2!: Rectangles
rect-right: Rectangles
rect-top: Rectangles
rect-union: Rectangles
rect-union!: Rectangles
rect-width: Rectangles
rect-within?: Rectangles
rect-x: Rectangles
rect-y: Rectangles
rect?: Rectangles
rectangle: Vector Paths
red: Colors
regular-polygon: Vector Paths
remove-particle-emitter: Particles
restore-window!: Window Manipulation
rgb: Colors
rgba: Colors
right-split: Vector Paths
rotate: Vector Paths
rounded-rectangle: Vector Paths
run-game: The Game Loop
run-game*: The Game Loop

S
sampler-2d: Shaders
sampler-cube: Shaders
scale: Vector Paths
schedule-after: Agendas
schedule-at: Agendas
schedule-every: Agendas
script: Scripts
script-cancelled?: Scripts
script-complete?: Scripts
script-running?: Scripts
script?: Scripts
set-canvas-matrix!: Vector Paths
set-canvas-painter!: Vector Paths
set-distance-model!: The Environment
set-doppler-factor!: The Environment
set-light-color!: Lights
set-light-cut-off!: Lights
set-light-direction!: Lights
set-light-position!: Lights
set-listener-orientation!: The Listener
set-listener-position!: The Listener
set-listener-velocity!: The Listener
set-listener-volume!: The Listener
set-rect-height!: Rectangles
set-rect-width!: Rectangles
set-rect-x!: Rectangles
set-rect-y!: Rectangles
set-source-audio!: Sources
set-source-cone-inner-angle!: Sources
set-source-cone-outer-angle!: Sources
set-source-cone-outer-volume!: Sources
set-source-direction!: Sources
set-source-loop!: Sources
set-source-max-distance!: Sources
set-source-max-volume!: Sources
set-source-min-volume!: Sources
set-source-pitch!: Sources
set-source-position!: Sources
set-source-reference-distance!: Sources
set-source-relative!: Sources
set-source-rolloff-factor!: Sources
set-source-velocity!: Sources
set-source-volume!: Sources
set-speed-of-sound!: The Environment
set-sprite-batch-texture!: Sprites
set-vec2!: Vectors
set-vec2-x!: Vectors
set-vec2-y!: Vectors
set-vec3!: Vectors
set-vec3-x!: Vectors
set-vec3-y!: Vectors
set-vec3-z!: Vectors
set-window-border!: Window Manipulation
set-window-fullscreen!: Window Manipulation
set-window-position!: Window Manipulation
set-window-size!: Window Manipulation
set-window-title!: Window Manipulation
shader-apply: Rendering Engine
shader-apply*: Rendering Engine
shader-apply/instanced: Rendering Engine
shader-apply/instanced: Rendering Engine
shader-attributes: Shaders
shader-data-type?: Shaders
shader-uniform: Shaders
shader-uniform-set!: Shaders
shader-uniforms: Shaders
shader?: Shaders
show-window!: Window Manipulation
skybox-cube-map: Skyboxes
skybox?: Skyboxes
sleep: Scripts
slide: Grids
smoothstep: Easings
source-cone-inner-angle: Sources
source-cone-outer-angle: Sources
source-cone-outer-volume: Sources
source-direction: Sources
source-max-distance: Sources
source-max-volume: Sources
source-min-volume: Sources
source-pause: Sources
source-paused?: Sources
source-pitch: Sources
source-play: Sources
source-playing?: Sources
source-position: Sources
source-reference-distance: Sources
source-relative?: Sources
source-rewind: Sources
source-rolloff-factor: Sources
source-stop: Sources
source-stopped?: Sources
source-toggle: Sources
source-velocity: Sources
source-volume: Sources
source?: Sources
spawn-script: Scripts
speed-of-sound: The Environment
split-texture: Textures
spot-light?: Lights
sprite-batch-add!: Sprites
sprite-batch-clear!: Sprites
sprite-batch-texture: Sprites
sprite-batch?: Sprites
square: Vector Paths
static-audio?: Audio Files
static-source?: Sources
stencil-test-function-back: Render Settings
stencil-test-function-front: Render Settings
stencil-test-function-mask-back: Render Settings
stencil-test-function-mask-front: Render Settings
stencil-test-mask-back: Render Settings
stencil-test-mask-front: Render Settings
stencil-test-on-depth-fail-back: Render Settings
stencil-test-on-depth-fail-front: Render Settings
stencil-test-on-fail-back: Render Settings
stencil-test-on-fail-front: Render Settings
stencil-test-on-pass-back: Render Settings
stencil-test-on-pass-front: Render Settings
stencil-test-reference-back: Render Settings
stencil-test-reference-front: Render Settings
stencil-test?: Render Settings
streaming-audio?: Audio Files
streaming-source?: Sources
string->color: Colors
strings->shader: Shaders
stroke: Vector Paths
superimpose: Vector Paths

T
tango-aluminium-1: Colors
tango-aluminium-2: Colors
tango-aluminium-3: Colors
tango-aluminium-4: Colors
tango-aluminium-5: Colors
tango-aluminium-6: Colors
tango-butter: Colors
tango-chameleon: Colors
tango-chocolate: Colors
tango-dark-butter: Colors
tango-dark-chameleon: Colors
tango-dark-chocolate: Colors
tango-dark-orange: Colors
tango-dark-plum: Colors
tango-dark-scarlet-red: Colors
tango-dark-sky-blue: Colors
tango-light-butter: Colors
tango-light-chameleon: Colors
tango-light-chocolate: Colors
tango-light-orange: Colors
tango-light-plum: Colors
tango-light-scarlet-red: Colors
tango-light-sky-blue: Colors
tango-orange: Colors
tango-plum: Colors
tango-scarlet-red: Colors
tango-sky-blue: Colors
tau: Basics
texture-atlas-ref: Textures
texture-atlas-texture: Textures
texture-atlas?: Textures
texture-height: Textures
texture-mag-filter: Textures
texture-min-filter: Textures
texture-parent: Textures
texture-region?: Textures
texture-width: Textures
texture-wrap-s: Textures
texture-wrap-t: Textures
texture?: Textures
tile-animation: Tile Maps
tile-id: Tile Maps
tile-layer-height: Tile Maps
tile-layer-name: Tile Maps
tile-layer-properties: Tile Maps
tile-layer-tiles: Tile Maps
tile-layer-width: Tile Maps
tile-layer?: Tile Maps
tile-map-height: Tile Maps
tile-map-layers: Tile Maps
tile-map-orientation: Tile Maps
tile-map-properties: Tile Maps
tile-map-tile-height: Tile Maps
tile-map-tile-width: Tile Maps
tile-map-tilesets: Tile Maps
tile-map-width: Tile Maps
tile-map?: Tile Maps
tile-properties: Tile Maps
tile?: Tile Maps
tileset-atlas: Tile Maps
tileset-columns: Tile Maps
tileset-first-gid: Tile Maps
tileset-name: Tile Maps
tileset-properties: Tile Maps
tileset-rows: Tile Maps
tileset-size: Tile Maps
tileset-tile-height: Tile Maps
tileset-tile-width: Tile Maps
tileset-tiles: Tile Maps
tileset?: Tile Maps
transform: Vector Paths
translate: Vector Paths
transparency: Colors
tween: Tweening

U
uniform-name: Shaders
uniform-type: Shaders
uniform-value: Shaders
uniform?: Shaders
unsigned-int: Shaders
up-split: Vector Paths
update-agenda: Agendas
update-particles: Particles

V
vec2: Vectors
vec2*: Vectors
vec2+: Vectors
vec2-: Vectors
vec2-add!: Vectors
vec2-clamp-to-rect!: Rectangles
vec2-copy: Vectors
vec2-copy!: Vectors
vec2-dot: Vectors
vec2-magnitude: Vectors
vec2-mult!: Vectors
vec2-normalize: Vectors
vec2-sub!: Vectors
vec2-x: Vectors
vec2-y: Vectors
vec2/polar: Vectors
vec2?: Vectors
vec3: Vectors
vec3*: Vectors
vec3+: Vectors
vec3-: Vectors
vec3-add!: Vectors
vec3-copy: Vectors
vec3-copy!: Vectors
vec3-cross: Vectors
vec3-cross!: Vectors
vec3-dot: Vectors
vec3-magnitude: Vectors
vec3-mult!: Vectors
vec3-normalize: Vectors
vec3-sub!: Vectors
vec3-x: Vectors
vec3-y: Vectors
vec3-z: Vectors
vec3?: Vectors
vertex-array-attributes: Buffers
vertex-array-indices: Buffers
vertex-array-mode: Buffers
vertex-array?: Buffers
vertex-attribute->buffer: Buffers
vertex-attribute-component-type: Buffers
vertex-attribute-divisor: Buffers
vertex-attribute-name: Buffers
vertex-attribute-offset: Buffers
vertex-attribute-type: Buffers
vertex-attribute?: Buffers
vertical-flip: Vector Paths
viewport-clear-color: Viewports
viewport-clear-flags: Viewports
viewport-height: Viewports
viewport-width: Viewports
viewport-x: Viewports
viewport-y: Viewports
viewport?: Viewports

W
wait-until: Scripts
white: Colors
window-height: Window Manipulation
window-title: Window Manipulation
window-width: Window Manipulation
window-x: Window Manipulation
window-y: Window Manipulation
window?: Window Manipulation
with-agenda: Agendas
with-graphics-state: Rendering Engine
with-mapped-buffer: Buffers
with-mapped-vertex-attribute: Buffers
with-projection: Rendering Engine
with-style: Vector Paths

Y
yellow: Colors
yield: Scripts

-
Jump to:   % -   -
-A -   -B -   -C -   -D -   -E -   -F -   -G -   -H -   -I -   -J -   -K -   -L -   -M -   -N -   -O -   -P -   -Q -   -R -   -S -   -T -   -U -   -V -   -W -   -Y -   -
- -
-
-

-Previous: , Up: Top   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Input-Devices.html b/manuals/chickadee/Input-Devices.html deleted file mode 100644 index 93b86d4..0000000 --- a/manuals/chickadee/Input-Devices.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - -Input Devices (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

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

-
-
-

5.1.2 Input Devices

- -

While run-game provides hooks for mouse/keyboard/controller -input events, it is often necessary to query input devices for their -current state. For example, it could be desirable to query the state -of the arrow keys every time the update hook is called to determine -which direction the player should move that frame. -

-
-
Procedure: key-pressed? key
-

Return #t if key is currently being pressed. -

- -
-
Procedure: key-released? key
-

Return #t if key is not currently being pressed. -

- -
-
Procedure: mouse-x
-

Return the current X coordinate of the mouse cursor. -

- -
-
Procedure: mouse-y
-

Return the current Y coordinate of the mouse cursor. -

- -
-
Procedure: mouse-button-pressed? button
-

Return #t if button is currently being pressed. -

- -
-
Procedure: mouse-button-released? button
-

Return #t if button is not currently being -pressed. -

- -
-
Procedure: controller-axis controller axis
-

Return a floating point value in the range [-1, 1] corresponding to -how much axis (an analog stick or trigger) is being pushed on -controller. 0 is returned if axis is not being pushed at -all. -

- -
-
Procedure: controller-name controller
-

Return the name of controller. -

- -
-
Procedure: controller-button-pressed? controller button
-

Return #t if button on controller is currently -being pressed. -

- -
-
Procedure: controller-button-released? controller button
-

Return #t if button on controller is not -currently being pressed. -

- - - - - - diff --git a/manuals/chickadee/Installation.html b/manuals/chickadee/Installation.html deleted file mode 100644 index 810d4d0..0000000 --- a/manuals/chickadee/Installation.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - -Installation (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Top   [Contents][Index]

-
-
-

1 Installation

- -

Chickadee is available for download from its website at -dthompson.us/projects/chickadee.html. This section describes -the software requirements of Chickadee, as well as how to install it. -

-

The build procedure for Chickadee is the same as for GNU software -packages, and is not covered here. Please see the files README -and INSTALL for additional details. -

- - - - - - - - - diff --git a/manuals/chickadee/Invoking-chickadee-bundle.html b/manuals/chickadee/Invoking-chickadee-bundle.html deleted file mode 100644 index 060c8ad..0000000 --- a/manuals/chickadee/Invoking-chickadee-bundle.html +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - -Invoking chickadee bundle (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Previous: , Up: Command Line Interface   [Contents][Index]

-
-
-

3.2 Invoking chickadee bundle

- -

Distributing games is difficult. While Chickadee games are free -software, it would be far too burdensome on the player to ask them to -compile a game from source in order to try it out. Many potential -players will simply not even try. Players expect to be able to -download a compressed archive, extract it, and play. If there are any -more steps than that then the chances of the game being played drop -dramatically. If you can’t beat ’em, join ’em. The -chickadee bundle tool creates redistributable binary bundles -by combining the game code and assets with shared libraries and -executables from the host operating system. -

-

Bundling is currently only supported on Linux. In the future, it may -be possible to bundle on MacOS. Patches very much welcome for that. -

-

It should be noted that bundling is a problematic way to distribute -software. All of the libraries that the bundled application includes -are separated from the distribution that was so carefully making sure -that they stay up-to-date with regard to security patches. The -bundled libraries are frozen in time, vulnerabilities and all. -Unfortunately, the release model used by the most popular -distributions, while wonderful for stable, mature software, does not -fit the needs of game distribution at all. So, we compromise, knowing -that most games are only played for only a short amount of time before -being disposed. Perhaps, in time, the Linux world will shift to using -more robust package management solutions such as -GNU Guix which support long-term -maintenance of stable software as well as the “fire and forget” -nature of game releases. And maybe a game made with Chickadee will -become so popular that major distributions decide to package it, but -let’s get back to reality. -

-

To get started with bundling, simply add a bundle.scm file to -the root of the project directory. It could look something like this: -

-
-
'((asset-directories . ("images" "models"))
-  (bundle-name . "the-legend-of-emacs-1.0")
-  (code . "the-legend-of-emacs.scm")
-  (launcher-name . "the-legend-of-emacs"))
-
- -

To create the bundle, simply run chickadee bundle. Upon -success, the file the-legend-of-emacs-1.0.tar.gz would be -created in the current directory. -

-

To maximize the chances that the bundle will work on someone else’s -computer, it’s best to build on the oldest supported Linux -distribution available. As of this writing, Ubuntu 18.04 LTS is a -good choice. -

-

In addition to including system libraries and executables, -chickadee bundle also includes the compiled Guile bytecode -(the .go files) for all modules used by the game. The module -source files are not included, so it’s critical that all of the -modules used by the game have been compiled. -

-

Available options: -

- - -

Default configuration options, such as the list of C shared libaries, -can be found in the %default-config variable. This way they -can be programatically modified, if necessary. -

-
-
Variable: %default-config
-

An association list of default configuration options. -

- -
-
-

-Previous: , Up: Command Line Interface   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Invoking-chickadee-play.html b/manuals/chickadee/Invoking-chickadee-play.html deleted file mode 100644 index 786626a..0000000 --- a/manuals/chickadee/Invoking-chickadee-play.html +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - -Invoking chickadee play (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Up: Command Line Interface   [Contents][Index]

-
-
-

3.1 Invoking chickadee play

- -

The chickadee play command is used to open a window and run -the Chickadee game contained within a Scheme source file. -

-
-
chickadee play the-legend-of-emacs.scm
-
- -

In this file, special procedures may be defined to handle various -events from the game loop: -

- - -

See The Game Loop for complete information on all of these -hooks, such as the arguments that each procedure receives. -

-

In additional to evaluating the specified source file, the directory -containing that file is added to Guile’s load path so that games can -easily be divided into many different files. Furthermore, that -directory is entered prior to evaluating the file so that data files -(images, sounds, etc.) can be loaded relative to the main source file, -regardless of what the current directory was when chickadee -play was invoked. -

-

Many aspects of the initial game window and environment can be -controlled via the following options: -

-
-
--title=title
-
-t title
-
-

Set the window title to title. -

-
-
--width=width
-
-w width
-
-

Set the window width to width pixels. -

-
-
--height=height
-
-h height
-
-

Set the window height to height pixels. -

-
-
--fullscreen
-
-f
-
-

Open window in fullscreen mode. -

-
-
--resizable
-
-r
-
-

Make window resizable. -

-
-
--update-hz=n
-
-u n
-
-

Update the game n times per second. -

-
-
--clear-color=color
-
-c color
-
-

Set the screen clear color to color, a hex code in the format -#RRGGBB. For example, to set the clear color to black, pass ---clear-color=#000000. -

-
-
--repl
-
-

Launch a REPL in the terminal. This will allow the game environment -to be debugged and modified without having to stop and restart the -game after each change. -

-
-
--repl-server[=port]
-
-

Launch a REPL server on port port, or 37146 by default. -

-

telnet localhost 37146 (or whatever port number was given) -will do the trick, but using the Geiser extension for Emacs is by far the best way to develop at the -REPL with Guile. Use M-x connect-to-guile to connect to the -REPL server. -

-
-
--language=language
-
-

Process the input program using language, the identifier of a -language within Guile’s language tower. By default, unsurprisingly, -Scheme is used. -

-

For example, to use the neat -Wisp language as an -alternative to Scheme’s parenthetical syntax, pass ---language=wisp. Wisp is not included with Guile and must be -installed separately. -

-
-
-x extension
-
-

Add extension to the list of file extensions that Guile will -load. -

-

For example, Wisp files canonically use the .w extension. -Here’s what a “hello, world” Chickadee program looks like in Wisp: -

-
-
define : draw alpha
-  draw-text "Hello, world!" : vec2 260.0 240.0
-
- -

Assuming the above code is saved to a hello.w file, -chickadee play be invoked as follows: -

-
-
chickadee play --language=wisp -x .w hello.w
-
- -
-
- -
-
-

-Next: , Up: Command Line Interface   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Kernel.html b/manuals/chickadee/Kernel.html deleted file mode 100644 index da55234..0000000 --- a/manuals/chickadee/Kernel.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - -Kernel (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Up: API Reference   [Contents][Index]

-
-
-

5.1 Kernel

- -

This section of the manual covers the foundation of Chickadee: The -game loop and desktop environment interaction. -

- - - - - - - - - - - diff --git a/manuals/chickadee/Lights.html b/manuals/chickadee/Lights.html deleted file mode 100644 index 4ae75ff..0000000 --- a/manuals/chickadee/Lights.html +++ /dev/null @@ -1,212 +0,0 @@ - - - - - - -Lights (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
-
-

5.3.9 Lights

- -

The (chickadee graphics light) module provides a data type for -dynamic lights that can be used to light 3D objects (such as -Models or Meshes.) -

-

There are 3 types of dynamic lights: -

- - -
-
Procedure: make-point-light [#:position (vec3 0 0 0)] [#:color black] [#:intensity 1]
-
-

Return a new point light located at position that emits -color light. -

- -
-
Procedure: make-directional-light [#:direction (vec3 0 -1 0)] [#:color black] [#:intensity 1]
-
-

Return a new directional light that emits color light in -direction. -

- -
-
Procedure: make-spot-light [#:position (vec3 0 0 0)] [#:direction (vec3 0 -1 0)] [#:color black] [#:cut-off π/4] [#:intensity 1]
-
-

Return a new spot light located at position that emits -color light in direction in a cone that cuts off at -cut-off radians. -

- -
-
Procedure: point-light? obj
-

Return #t if obj is a point light. -

- -
-
Procedure: directional-light? obj
-

Return #t if obj is a directional light. -

- -
-
Procedure: spot-light? obj
-

Return #t if obj is a spot light. -

- -
-
Procedure: light-type light
-

Return the type of light, one of: -

-
    -
  • point -
  • directional -
  • spot -
- -
- -
-
Procedure: light-color light
-

Return the color of light. -

- -
-
Procedure: light-intensity light
-

Return the intensity of light. -

- -
-
Procedure: light-position light
-

Return the position of light. The value is irrelevant for -directional lights. -

- -
-
Procedure: light-direction light
-

Return the direction of light. The value is irrelevant for -point lights. -

- -
-
Procedure: light-cut-off light
-

Return the cosine of the cut off angle of light. The value is -only relevant for spot lights. -

- -
-
Procedure: set-light-color! light color
-

Set the color of light to color. -

- -
-
Procedure: set-light-position! light position
-

Set the position of light to position. -

- -
-
Procedure: set-light-direction! light direction
-

Set the direction of light to direction. -

- -
-
Procedure: set-light-cut-off! light cut-off
-

Set the cut off angle of light to cut-off. -

- -
-
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Live-Coding.html b/manuals/chickadee/Live-Coding.html deleted file mode 100644 index e34b29e..0000000 --- a/manuals/chickadee/Live-Coding.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - -Live Coding (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Top   [Contents][Index]

-
-
-

4 Live Coding

- -

One of the biggest appeals of any Lisp dialect is the ability to use -the “read-eval-print loop” (REPL for short) to build programs -iteratively and interactively while the program is running. However, -programs that run in an event loop and respond to user input (such as -a game using the Chickadee library!) require special care for this -workflow to be pleasant. -

-

If you are using the chickadee play command to run your -game, then the --repl or --repl-server arguments are all -you need to get a live coding environment running. -

-

If, however, you are using run-game to start the game loop then -it’s still fairly easy to hook up a special kind of REPL by yourself. -

-

First, create a cooperative REPL server (It’s important to use Guile’s -cooperative REPL server instead of the standard REPL server in -(system repl server) to avoid thread synchronization issues). -Then, in the game loop’s update procedure, call -poll-coop-repl-server and pass the REPL object. Here is a -template to follow: -

-
-
(use-modules (chickadee)
-             (system repl coop-server))
-
-(define repl (spawn-coop-repl-server))
-
-(define (update dt)
-  (poll-coop-repl-server repl)
-  ...)
-
-(run-game #:update update ...)
-
- -

To use the REPL, connect to it via port 37146. Telnet will do the -trick, but using the Geiser -extension for Emacs is by far the best way to develop at the REPL with -Guile. Use M-x connect-to-guile to connect to the REPL server. -

- - - - - diff --git a/manuals/chickadee/Math.html b/manuals/chickadee/Math.html deleted file mode 100644 index 7b6456c..0000000 --- a/manuals/chickadee/Math.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - -Math (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: API Reference   [Contents][Index]

-
-
-

5.2 Math

- -

Chickadee contains data types and procedures for performing the most -common computations in video game simulations such as linear algebra -with vectors and matrices and axis-aligned bounding box collision -detection. -

- - - - - - - - - - - - - - - diff --git a/manuals/chickadee/Matrices.html b/manuals/chickadee/Matrices.html deleted file mode 100644 index bf65917..0000000 --- a/manuals/chickadee/Matrices.html +++ /dev/null @@ -1,409 +0,0 @@ - - - - - - -Matrices (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Math   [Contents][Index]

-
-
-

5.2.4 Matrices

- -

The (chickadee math matrix) module provides an interface for -working with the most common type of matrices in game development: 4x4 -transformation matrices. -

-

Another Note About Performance -

-

Much like the vector API, the matrix API is commonly used in -performance critical code paths. In order to reduce the amount of -garbage generated and improve matrix multiplication performance, there -are many procedures that perform in-place modifications of matrix -objects. -

-

5.2.4.1 3x3 Matrices

- -
-
Procedure: make-matrix3 aa ab ac ba bb bc ca cb cc
-

Return a new 3x3 initialized with the given 9 values in column-major -format. -

- -
-
Procedure: make-null-matrix3
-

Return a new 3x3 matrix with all values initialized to 0. -

- -
-
Procedure: make-identity-matrix3
-

Return a new 3x3 identity matrix. Any matrix multiplied by the -identity matrix yields the original matrix. This procedure is -equivalent to the following code: -

-
-
(make-matrix3 1 0 0
-              0 1 0
-              0 0 1)
-
- -
- -
-
Procedure: matrix3? obj
-

Return #t if obj is a 3x3 matrix. -

- -
-
Procedure: matrix3= m1 m2
-

Return #t if m1 is the same matrix as m2. -

- -
-
Procedure: matrix3-copy matrix
-

Return a new 3x3 matrix that is a copy of matrix. -

- -
-
Procedure: matrix3* . matrices
-

Return a new 3x3 matrix containing the product of multiplying all of -the given matrices. -

-

Note: Remember that matrix multiplication is not commutative! -

- -
-
Procedure: matrix3-translate v
-

Return a new 3x3 matrix that represents a translation by v, a 2D -vector. -

- -
-
Procedure: matrix3-scale s
-

Return a new 3x3 matrix that represents a scaling along the x and y -axes by the scaling factor s, a number or 2D vector. -

- -
-
Procedure: matrix3-rotate angle
-

Return a new 3x3 matrix that represents a rotation by angle -radians. -

- -
-
Procedure: matrix3-transform matrix v
-

Return a new 2D vector that is v as transformed by the 3x3 -matrix matrix. -

- -
-
Procedure: matrix3-inverse matrix
-

Return the inverse of matrix. -

- -

The following procedures perform in-place, destructive updates to 3x3 -matrix objects: -

-
-
Procedure: matrix3-copy! src dest
-

Copy the contents of matrix src to dest. -

- -
-
Procedure: matrix3-identity! matrix
-

Modify matrix in-place to contain the identity matrix. -

- -
-
Procedure: matrix3-mult! dest a b
-

Multiply the 3x3 matrix a by the 3x3 matrix b and store -the result in the 3x3 matrix dest. -

- -
-
Procedure: matrix3-translate! matrix v
-

Modify matrix in-place to contain a translation by v, a 2D -vector. -

- -
-
Procedure: matrix3-scale! matrix s
-

Modify matrix in-place to contain a scaling along the x and y -axes by the scaling factor s, a number or 2D vector. -

- -
-
Procedure: matrix3-rotate! matrix angle
-

Modify matrix in-place to contain a rotation by angle -radians. -

- -
-
Procedure: matrix3-transform! matrix v
-

Modify the 2D vector v in-place to contain v as -transformed by the 3x3 matrix matrix. -

- -
-
Procedure: matrix3-inverse! matrix target
-

Compute the inverse of matrix and store the results in -target. -

- -

5.2.4.2 4x4 Matrices

- -
-
Procedure: make-matrix4 aa ab ac ad ba bb bc bd ca cb cc cd da db dc dd
-
-

Return a new 4x4 matrix initialized with the given 16 values in -column-major format. -

- -
-
Procedure: make-null-matrix4
-

Return a new 4x4 matrix with all values initialized to 0. -

- -
-
Procedure: make-identity-matrix4
-

Return a new 4x4 identity matrix. Any matrix multiplied by the -identity matrix yields the original matrix. This procedure is -equivalent to the following code: -

-
-
(make-matrix4 1 0 0 0
-              0 1 0 0
-              0 0 1 0
-              0 0 0 1)
-
- -
- -
-
Procedure: matrix4? obj
-

Return #t if obj is a 4x4 matrix. -

- -
-
Procedure: matrix4= m1 m2
-

Return #t if m1 is the same matrix as m2. -

- -
-
Procedure: matrix4-copy matrix
-

Return a new 4x4 matrix that is a copy of matrix. -

- -
-
Procedure: matrix4* . matrices
-

Return a new 4x4 matrix containing the product of multiplying all of -the given matrices. -

-

Note: Remember that matrix multiplication is not commutative! -

- -
-
Procedure: matrix4-inverse matrix
-

Return the inverse of matrix. -

-

A matrix multiplied by its inverse is the identity matrix, thought not -always exactly due to the nature of floating point numbers. -

- -
-
Procedure: orthographic-projection left right top bottom near far
-
-

Return a new 4x4 matrix that represents an orthographic (2D) -projection for the horizontal clipping plane top and -bottom, the vertical clipping plane top and bottom, -and the depth clipping plane near and far. -

- -
-
Procedure: perspective-projection fov aspect-ratio near far
-
-

Return a new 4x4 matrix that represents a perspective (3D) projection -with a field of vision of fov radians, an aspect ratio of -aspect-ratio, and a depth clipping plane defined by near -and far. -

- -
-
Procedure: matrix4-translate x
-

Return a new 4x4 matrix that represents a translation by x, a 2D -vector, a 3D vector, or a rectangle (in which case the bottom-left -corner of the rectangle is used). -

- -
-
Procedure: matrix4-scale s
-

Return a new 4x4 matrix that represents a scaling along the X, Y, and -Z axes by the scaling factor s, a real number. -

- -
-
Procedure: matrix4-rotate q
-

Return a new 4x4 matrix that represents a rotation about an arbitrary -axis defined by the quaternion q. -

- -
-
Procedure: matrix4-rotate-z theta
-

Return a new 4x4 matrix that represents a rotation about the Z axis by -theta radians. -

- -

The following procedures perform in-place, destructive updates to 4x4 -matrix objects: -

-
-
Procedure: matrix4-copy! src dest
-

Copy the contents of matrix src to dest. -

- -
-
Procedure: matrix4-identity! matrix
-

Modify matrix in-place to contain the identity matrix. -

- -
-
Procedure: matrix4-mult! dest a b
-

Multiply the 4x4 matrix a by the 4x4 matrix b and store -the result in the 4x4 matrix dest. -

- -
-
Procedure: matrix4-inverse! matrix target
-

Compute the inverse of matrix and store the result in -target. -

- -
-
Procedure: matrix4-translate! matrix x
-

Modify matrix in-place to contain a translation by x, a 2D -vector, a 3D vector, or a rectangle (in which case the bottom-left -corner of the rectangle is used). -

- -
-
Procedure: matrix4-scale! matrix s
-

Modify matrix in-place to contain a scaling along the X, Y, and -Z axes by the scaling factor s, a real number. -

- -
-
Procedure: matrix4-rotate! matrix q
-

Modify matrix in-place to contain a rotation about an arbitrary -axis defined by the quaternion q. -

- -
-
Procedure: matrix4-rotate-z! matrix theta
-

Modify matrix in-place to contain a rotation about the Z axis by -theta radians. -

- -
-
Procedure: matrix4-2d-transform! matrix [#:origin] [#:position] [#:rotation] [#:scale] [#:shear]
-
-

Modify matrix in-place to contain the transformation described -by position, a 2D vector or rectangle, rotation, a scalar -representing a rotation about the Z axis, scale, a 2D vector, -and shear, a 2D vector. The transformation happens with respect -to origin, a 2D vector. If an argument is not provided, that -particular transformation will not be included in the result. -

- -
-
Procedure: matrix4-transform! matrix v
-

Modify the 2D vector v in-place by multiplying it by the 4x4 -matrix matrix. -

- -
-
-

-Next: , Previous: , Up: Math   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Meshes.html b/manuals/chickadee/Meshes.html deleted file mode 100644 index 7e66c4d..0000000 --- a/manuals/chickadee/Meshes.html +++ /dev/null @@ -1,413 +0,0 @@ - - - - - - -Meshes (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
-
-

5.3.11 Meshes

- -

The (chickadee graphics mesh) modules provides procedures for -programmatically creating 3D objects (to load 3D models from a file on -disk, see Meshes.) -

-

5.3.11.1 Materials

- -

Before we talk about meshes themselves, let’s discuss “materials.” -Materials control the appearance of 3D objects. Whether an object -appears like a rough rock, a smooth and shiny metal, etc. depends on -the material that is applied to it. Different types of materials use -different lighting models. Chickadee supports two lighting models: -The classic Blinn-Phong model and a more modern physically based -rendering (PBR) model. -

-

All materials share some common data: -

-
-
Procedure: material? obj
-

Return #t if obj is a material. -

- -
-
Procedure: material-name material
-

Return the name of material. -

- -
-
Procedure: material-shader material
-

Return the shader of material. -

- -
-
Procedure: material-blend-mode material
-

Return the blend mode of material. -

- -
-
Procedure: material-polygon-mode material
-

Return the polygon mode of material. -

- -
-
Procedure: material-cull-face-mode material
-

Return the cull face mode of material. -

- -
-
Procedure: material-depth-test material
-

Return the depth test of material. -

- -
-
Procedure: material-stencil-test material
-

Return the stencil test of material. -

- -
-
Procedure: material-multisample? material
-

Return #t if material uses multisampling. -

- -

Materials support 5 textures. What each texture is used for depends -on the lighting model. -

-
-
Procedure: material-texture-0 material
-

Return the first texture of material. -

- -
-
Procedure: material-texture-1 material
-

Return the second texture of material. -

- -
-
Procedure: material-texture-2 material
-

Return the third texture of material. -

- -
-
Procedure: material-texture-3 material
-

Return the fourth texture of material. -

- -
-
Procedure: material-texture-4 material
-

Return the fifth texture of material. -

- -

For all data that is specific to the lighting model, materials have a -“properties” field. -

-
-
Procedure: material-properties material
-

Return the lighting model specific properties of material. -

- -

5.3.11.2 Blinn-Phong Materials

- -

The (chickadee graphics phong) module has the Blinn-Phong -lighting model: -

-
-
Procedure: make-phong-material [#:name "anonymous"] [#:blend-mode] [#:polygon-mode] [#:cull-face-mode] [#:depth-test] [#:stencil-test] [#:multisample? #f] [#:ambient-factor (vec3 1 1 1)] [#:diffuse-factor (vec3 1 1 1)] [#:specular-factor (vec3 1 1 1)] [#:shininess 32] [#:ambient-texture] [#:diffuse-texture] [#:specular-texture] [#:normal-texture]
-
-

Return a new Blinn-Phong material. -

- -
-
Procedure: make-phong-properties [#:ambient] [#:diffuse] [#:specular] [#:shininess]
-
-

Return a new Blinn-Phong properties object. -

- -
-
Procedure: phong-properties? obj
-

Return #t if obj is a Blinn-Phong properties object. -

- -
-
Procedure: phong-properties-ambient properties
-

Return the ambient factor of properties. -

- -
-
Procedure: phong-properties-diffuse properties
-

Return the diffuse factor of properties. -

- -
-
Procedure: phong-properties-specular properties
-

Return the specular factor of properties. -

- -
-
Procedure: phong-properties-shininess properties
-

Return the shininess factor of properties. -

- -

5.3.11.3 PBR Materials

- -

The (chickadee graphics pbr) module has the PBR lighting model: -

-
-
Procedure: make-pbr-material [#:name "anonymous"] [#:blend-mode] [#:polygon-mode] [#:cull-face-mode] [#:depth-test] [#:stencil-test] [#:multisample? #f] [#:base-color-factor (vec3 1 1 1)] [#:base-color-texcoord 0] [#:metallic-factor 1.0] [#:roughness-factor 1.0] [#:metallic-roughness-texcoord 0] [#:normal-texcoord 0] [#:occlusion-texcoord 0] [#:emissive-factor (vec3 1 1 1)] [#:emissive-texcoord 0] [#:alpha-mode opaque] [#:alpha-cutoff 0.5] [#:base-color-texture] [#:metallic-roughness-texture] [#:normal-texture] [#:occlusion-texture] [#:emissive-texture]
-
-

Return a new PBR material. -

- -
-
Procedure: make-pbr-properties [#:base-color-factor] [#:base-color-texcoord] [#:metallic-factor] [#:roughness-factor] [#:metallic-roughness-texcoord] [#:normal-texcoord] [#:occlusion-texcoord] [#:emissive-factor] [#:emissive-texcoord] [#:alpha-mode] [#:alpha-cutoff]
-
-

Return a new PBR properties object. -

- -
-
Procedure: pbr-properties? obj
-

Return #t if obj is a PBR properties object. -

- -
-
Procedure: pbr-properties-base-color-factor properties
-

Return the base color factor of properties. -

- -
-
Procedure: pbr-properties-base-color-texcoord properties
-

Return the base color texture coordinate attribute index of -properties. -

- -
-
Procedure: pbr-properties-metallic-factor properties
-

Return the metallic factor of properties. -

- -
-
Procedure: pbr-properties-roughness properties
-

Return the roughness factor of properties. -

- -
-
Procedure: pbr-properties-metallic-roughness-texcoord properties
-

Return the metallic-roughness texture coordinate attribute index of -properties. -

- -
-
Procedure: pbr-properties-normal-texcoord properties
-

Return the normal texture coordinate attribute index of -properties. -

- -
-
Procedure: pbr-properties-occlusion-texcoord properties
-

Return the ambient occlusion texture coordinate attribute index of -properties. -

- -
-
Procedure: pbr-properties-emissive-factor properties
-

Return the emissive factor of properties. -

- -
-
Procedure: pbr-properties-emissive-texcoord properties
-

Return the emissive texture coordinate attribute index of -properties. -

- -
-
Procedure: pbr-properties-alpha-mode properties
-

Return the alpha mode of properties. -

- -
-
Procedure: pbr-properties-alpha-cutoff properties
-

Return the alpha cutoff threshold of properties. -

- -

5.3.11.4 Primitives and Meshes

- -

A mesh is a collection of “primitives,” so we should discuss those -next. A primitive contains vertex data and a material. -

-
-
Procedure: make-primitive name vertex-array material
-

Return a new primitive named name that renders -vertex-array (see Buffers) using material. -

- -
-
Procedure: primitive? obj
-

Return #t if obj is a primitive. -

- -
-
Procedure: primitive-name primitive
-

Return the name of primitive. -

- -
-
Procedure: primitive-vertex-array primitive
-

Return the vertex array of primitive. -

- -
-
Procedure: primitive-material primitive
-

Return the material of primitive. -

- -

Okay, now we can talk about meshes, which are just a glorified list of -primitive objects. -

-
-
Procedure: make-mesh name primitives
-

Return a new mesh named name that is composed of the list -primitives. -

- -
-
Procedure: mesh? obj
-

Return #t if obj is a mesh. -

- -
-
Procedure: mesh-name mesh
-

Return the name of mesh. -

- -
-
Procedure: mesh-primitives mesh
-

Return the list of primitives for mesh. -

- -

The mesh module also conveniently provides procedures to build several -basic 3D shapes. -

-
-
Procedure: make-plane length width material
-

Return a new mesh that forms a flat plane on the XZ axis that is -width units long along the X axis and length units long -along the Z axis. -

- -
-
Procedure: make-tesselated-plane length width resolution material
-

Return a new mesh that forms a tesselated plane on the XZ axis that is -width units long along the X axis and length units long -along the Z axis. -

-

A regular plane is a single rectangle, but a tesselated plane is -subdivided into many smaller rectangles by resolution. This -allows for transforming the vertices in a shader to achieve effects -such as waves in water or mountainous terrain. -

- -
-
Procedure: make-cube size material
-

Return a new mesh that forms a cube that is size units big. -

- -
-
Procedure: make-sphere radius material [#:quality 2]
-

Return a new mesh that forms a sphere that has a radius of -radius units. Since 3D models are composed of triangles, the -quality of a sphere is entirely dependent upon how many triangles are -used to appromixate the shape. The higher the value of quality, -the better the appromixation, but the more time it will take to -generate and the more expensive it will be to draw. The number of -triangles in the resulting sphere increases exponentially with each -increment to quality. -

- -
-
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Models.html b/manuals/chickadee/Models.html deleted file mode 100644 index 4d319a1..0000000 --- a/manuals/chickadee/Models.html +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - -Models (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
-
-

5.3.8 Models

- -

Disclaimer: Chickadee is alpha software, but 3D model support is -even more alpha than that. There are many missing features in both -the model loading and rendering components, so set your expectations -accordingly! -

-

The (chickadee graphics model) module provides procedures to -load and render 3D models in the classic OBJ and more modern glTF 2.0 -formats. -

-

Here’s some basic boilerplate to render a 3D model: -

-
-
(use-modules (chickadee graphics light)
-             (chickadee graphics model)
-             (chickadee graphics skybox))
-
-(define model (load-gltf "Suzanne.gltf"))
-(define camera-position (vec3 0.0 0.0 3.0))
-(define world (make-identity-matrix4))
-(define view (look-at camera-position (vec3 0.0 0.0 0.0) (vec3 0.0 1.0 0.0)))
-(define projection (perspective-projection (/ pi 3.0) (/ 4.0 3.0) 0.1 5.0))
-
-(define (draw alpha)
-  (with-projection projection
-    (draw-model model world view camera-position
-
- -
-
Procedure: load-obj file-name
-

Load the OBJ formatted model in file-name and return a 3D model -object. -

-

OBJ models are rendered using a Phong lighting model, which is a -work-in-progress. -

- -
-
Procedure: load-gltf file-name
-

Load the glTF 2.0 formatted model in file-name and return a 3D -model object. -

-

glTF models are rendered using a physically based lighting model, -which is currently a stub to be implemented later. -

- -
-
Procedure: model? obj
-

Return #t if obj is a 3D model. -

- -
-
Procedure: draw-model model [#:model-matrix] [#:view-matrix] [#:camera-position (vec3 0 0 0)] [#:skybox] [#:lights '()]
-
-

Render model with the transformation matrices model-matrix -and view-matrix applied. camera-position is the world -position of the camera, for correct specular lighting calculations. -skybox is used to apply ambient lighting to the model. -lights contains all of the dynamic lights (see Lights) that -should have an effect on the model. -

- -

Models are composed of simpler data types: meshes, primitives, and -materials. Let’s start with materials. A material controls the -appearance of a 3D object. Is the object a rough stone? Or maybe a -smooth metal? Materials control all of this and more. -

-

There are two types of materials in Chickadee: Phong and PBR. -

-
-
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Particles.html b/manuals/chickadee/Particles.html deleted file mode 100644 index 116e2e6..0000000 --- a/manuals/chickadee/Particles.html +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - -Particles (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
-
-

5.3.6 Particles

- -

Effects like smoke, fire, sparks, etc. are often achieved by animating -lots of little, short-lived sprites known as “particles”. In fact, -all of these effects, and more, can be accomplished by turning a few -configuration knobs in a “particle system”. A particle system takes -care of managing the many miniscule moving morsels so the developer -can quickly produce an effect and move on with their life. The -(chickadee graphics particles) module provides an API for -manipulating particle systems. -

-

Below is an example of a very simple particle system that utilizes -nearly all of the default configuration settings: -

-
-
(use-modules (chickadee graphics particles))
-(define texture (load-image "particle.png"))
-(define particles (make-particles 2000 #:texture texture))
-
- -

In order to put particles into a particle system, a particle -“emitter” is needed. Emitters know where to spawn new particles, -how many of them to spawn, and for how long they should do it. -

-

Below is an example of an emitter that spawns 16 particles per frame -at the coordinates (320, 240): -

-
-
(use-modules (chickadee math rect))
-(define emitter (make-particle-emitter (make-rect 0.0 0.0 320.0 240.0) 16))
-(add-particle-emitter particles emitter)
-
- -

To see all of the tweakable knobs and switches, read on! -

-
-
Procedure: make-particles capacity [#:blend-mode] [#:color white] [#:end-color transparent] [#:texture] [#:animation-rows 1] [#:animation-columns 1] [#:width] [#:height] [#:speed-range (vec2 0.1 1.0)] [#:acceleration-range (vec2 0.0 0.1)] [#:direction-range (vec2 0 (* 2 pi))] [#:lifetime 30] [#:sort]
-
-

Return a new particle system that may contain up to capacity -particles. Achieving the desired particle effect involves tweaking -the following keyword arguments as needed: -

-

- blend-mode: Pixel blending mode. Alpha blending is used by -default. (see Render Settings for more about blend modes). -

-

- start-color: The tint color of the particle at the beginning of its -life. White by default. -

-

- end-color: The tint color of the particle at the end of of its -life. Completely transparent by default for a fade-out effect. The -color in the middle of a particle’s life will be an interpolation of -start-color and end-color. -

-

- texture: The texture applied to the particles. The texture -may be subdivided into many animation frames. -

-

- animation-rows: How many animation frame rows there are in the -texture. Default is 1. -

-

- animation-columns: How many animation frame columns there are -in the texture. Default is 1. -

-

- width: The width of each particle. By default, the width of -an animation frame (in pixels) is used. -

-

- height: The height of each particle. By default, the height -of an animation frame (in pixels) is used. -

-

- speed-range: A 2D vector containing the min and max particle -speed. Each particle will have a speed chosen at random from this -range. By default, speed ranges from 0.1 to 1.0. -

-

- acceleration-range: A 2D vector containing the min and max -particle acceleration. Each particle will have an acceleration chosen -at random from this range. By default, acceleration ranges from 0.0 -to 0.1. -

-

- direction-range: A 2D vector containing the min and max -particle direction as an angle in radians. Each particle will have a -direction chosen at random from this range. By default, the range -covers all possible angles. -

-

- lifetime: How long each particle lives, measured in -updates. 30 by default. -

-

- sort: youngest if youngest particle should be drawn -last or oldest for the reverse. By default, no sorting is -applied at all. -

- -
-
Procedure: particles? obj
-

Return #t if obj is a particle system. -

- -
-
Procedure: update-particles particles
-

Advance the simulation of particles. -

- -
-
Procedure: draw-particles particles
-

Render particles. -

- -
-
Procedure: draw-particles* particles matrix
-

Render particles with matrix applied. -

- -
-
Procedure: make-particle-emitter spawn-area rate [duration]
-
-

Return a new particle emitter that spawns rate particles per -frame within spawn-area (a rectangle or 2D vector) for -duration frames. If duration is not specified, the -emitter will spawn particles indefinitely. -

- -
-
Procedure: particle-emitter? obj
-

Return #t if obj is a particle emitter. -

- -
-
Procedure: particle-emitter-spawn-area emitter
-

Return the spawn area for emitter. -

- -
-
Procedure: particle-emitter-rate emitter
-

Return the number of particles that emitter will spawn per -frame. -

- -
-
Procedure: particle-emitter-life emitter
-

Return the number of frames remaining in emitter’s lifespan. -

- -
-
Procedure: particle-emitter-done? emitter
-

Return #t if emitter has finished spawning particlces. -

- -
-
Procedure: add-particle-emitter particles emitter
-

Add emitter to particles. -

- -
-
Procedure: remove-particle-emitter particles emitter
-

Remove emitter from particles -

- -
-
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Path-Finding.html b/manuals/chickadee/Path-Finding.html deleted file mode 100644 index 150ef88..0000000 --- a/manuals/chickadee/Path-Finding.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - -Path Finding (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Previous: , Up: Data Structures   [Contents][Index]

-
-
-

5.6.6 Path Finding

- -

Most game worlds have maps. Often, these games have a need to move -non-player characters around in an unscripted fashion. For example, -in a real-time strategy game, the player may command one of their -units to attack something in the enemy base. To do so, the unit must -calculate the shortest route to get there. It wouldn’t be a very fun -game if units didn’t know how to transport themselves efficiently. -This is where path finding algorithms come in handy. The -(chickadee data path-finding) module provides a generic -implementation of the popular A* path finding algorithm. Just add a -map implementation! -

-

The example below defines a very simple town map and finds the -quickest way to get from the town common to the school. -

-
-
(define world-map
-  '((town-common . (town-hall library))
-    (town-hall . (town-common school))
-    (library . (town-common cafe))
-    (school . (town-hall cafe))
-    (cafe . (library school))))
-(define (neighbors building)
-  (assq-ref town-map building))
-(define (cost a b) 1)
-(define (distance a b) 1)
-(define pf (make-path-finder))
-(a* pf 'town-common 'school neighbors cost distance)
-
- -

In this case, the a* procedure will return the list -(town-common town-hall school), which is indeed the shortest -route. (The other possible route is (town-common library cafe -school).) -

-

The a* procedure does not know anything about about any kind of -map and therefore must be told how to look up neighboring nodes, which -is what the neighbors procedure in the example does. To -simulate different types of terrain, a cost procedure is used. In -this example, it is just as easy to move between any two nodes because -cost always returns 1. In a real game, perhaps moving from -from a field to a rocky hill would cost a lot more than moving from -one field to another. Finally, a heuristic is used to calculate an -approximate distance between two nodes on the map. In this simple -association list based graph it is tough to calculate a distance -between nodes, so the distance procedure isn’t helpful and -always returns 1. In a real game with a tile-based map, for example, -the heuristic could be a quick Manhattan distance calculation based on -the coordinates of the two map tiles. Choose an appropriate heuristic -for optimal path finding! -

-
-
Procedure: make-path-finder
-

Return a new path finder object. -

- -
-
Procedure: path-finder? obj
-

Return #t if obj is a path finder. -

- -
-
Procedure: a* path-finder start goal neighbors cost distance
-
-

Return a list of nodes forming a path from start to goal -using path-finder to hold state. neighbors is a procedure -that accepts a node and returns a list of nodes that neighbor it. -cost is a procedure that accepts two neighboring nodes and -returns the cost of moving from the first to the second as a real -number. distance is a procedure that accepts two nodes and -returns an approximate distance between them. -

- -
-
-

-Previous: , Up: Data Structures   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Quadtrees.html b/manuals/chickadee/Quadtrees.html deleted file mode 100644 index 5675542..0000000 --- a/manuals/chickadee/Quadtrees.html +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - -Quadtrees (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Data Structures   [Contents][Index]

-
-
-

5.6.4 Quadtrees

- -

The (chickadee data quadtree) module provides a 2D spatial -partitioning implementation known as a “quadtree”. A quadtree -recursively subdivides the world into rectangular quadrants. This -data structure is very useful for handling broad-phase collision -detection because it can quickly determine the objects that may -possibly be colliding with another, resulting in fewer narrow-phase -collision tests that are typically much more expensive. -

-
-
Procedure: make-quadtree bounds [#:max-size 5] [#:max-depth 4]
-

Return a new quadtree that covers the area bounds. Each node -will try to hold at maximum max-size objects and the tree depth -will be restricted to max-depth. -

- -
-
Procedure: quadtree? obj
-

Return #t if obj is a quadtree. -

- -
-
Procedure: quadtree-clear! quadtree
-

Clear all objects from quadtree. -

- -
-
Procedure: quadtree-insert! quadtree rect object
-

Insert object with bounding box rect into quadtree. -

- -
-
Procedure: quadtree-delete! quadtree rect object
-

Delete object, who occupies the space rect, from -quadtree. -

- -
-
Procedure: quadtree-find rect pred
-

Return the first object in quadtree in the vicinity of -rect that satisfies pred. -

- -
-
Procedure: quadtree-fold quadtree rect init proc
-

Apply proc to all objects in the vicinity of rect in -quadtree to build a result and return that result. init -is the initial result. If there are no objects in the vicinity of -rect, just init is returned. -

- -
-
Procedure: quadtree-for-each quadtree rect proc
-

Call proc for all objects in the vicinity of rect in -quadtree. -

- -
-
Procedure: quadtree-leaf? quadtree
-

Return #t if quadtree is a leaf node. -

- -
-
Procedure: quadtree-bounds quadtree
-

Return the bounding rectangle of quadtree. -

- -
-
Procedure: quadtree-max-depth quadtree
-

Return the maximum depth of quadtree. -

- -
-
Procedure: quadtree-max-size quadtree
-

Return the desired per-node maximum object count of quadtree. -

- -
-
Procedure: quadtree-depth quadtree
-

Return the depth of the node quadtree. -

- -
-
Procedure: quadtree-size quadtree
-

Return the number of objects stored in the node quadtree. -

- -

Non-leaf nodes always have four child nodes, which correspond to the -quadrants of a Cartesian coordinate system: -

-
*------*------*
-|      |      |
-|  Q2  |  Q1  |
-|      |      |
-*------*------*
-|      |      |
-|  Q3  |  Q4  |
-|      |      |
-*------*------*
-
-
-
Procedure: quadtree-q1 quadtree
-

Return the upper-right child node of quadtree, or #f if -quadtree is a leaf node. -

- -
-
Procedure: quadtree-q2 quadtree
-

Return the upper-left child node of quadtree, or #f if -quadtree is a leaf node. -

- -
-
Procedure: quadtree-q3 quadtree
-

Return the lower-left child node of quadtree, or #f if -quadtree is a leaf node. -

- -
-
Procedure: quadtree-q4 quadtree
-

Return the lower-right child node of quadtree, or #f if -quadtree is a leaf node. -

- -
-
-

-Next: , Previous: , Up: Data Structures   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Quaternions.html b/manuals/chickadee/Quaternions.html deleted file mode 100644 index be875ee..0000000 --- a/manuals/chickadee/Quaternions.html +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - -Quaternions (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Math   [Contents][Index]

-
-
-

5.2.5 Quaternions

- -

In game development, the quaternion is most often used to represent -rotations. Why not use a matrix for that, you may ask. Unlike -matrices, quaternions can be interpolated (animated) and produce a -meaningful result. When interpolating two quaternions, there is a -smooth transition from one rotation to another, whereas interpolating -two matrices would yield garbage. -

-
-
Procedure: quaternion x y z w
-

Return a new quaternion with values x, y, z, and -w. -

- -
-
Procedure: quaternion? obj
-

Return #t if obj is a quaternion. -

- -
-
Procedure: quaternion-w q
-

Return the W component of the quaternion q. -

- -
-
Procedure: quaternion-x q
-

Return the X component of the quaternion q. -

- -
-
Procedure: quaternion-y q
-

Return the Y component of the quaternion q. -

- -
-
Procedure: quaternion-z q
-

Return the Z component of the quaternion q. -

- -
-
Procedure: make-identity-quaternion
-

Return the identity quaternion. -

- - - - - - diff --git a/manuals/chickadee/Queues.html b/manuals/chickadee/Queues.html deleted file mode 100644 index 9e5d238..0000000 --- a/manuals/chickadee/Queues.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - -Queues (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Data Structures   [Contents][Index]

-
-
-

5.6.2 Queues

- -

The (chickadee data queue) module provides a mutable queue that -is more memory efficient than Guile’s built-in (ice-9 q) -module. -

-
-
Procedure: make-queue
-

Return a new, empty queue. -

- -
-
Procedure: queue? obj
-

Return #t if obj is a queue. -

- -
-
Procedure: queue-empty? queue
-

Return #t if queue is empty. -

- -
-
Procedure: queue-length queue
-

Return the current length of queue. -

- -
-
Procedure: enqueue! queue item
-

Add item to queue. -

- -
-
Procedure: dequeue! queue
-

Remove and return the first item in queue. -

- -
-
Procedure: queue-clear! queue
-

Remove all items from queue. -

- - - - - - diff --git a/manuals/chickadee/Rectangles.html b/manuals/chickadee/Rectangles.html deleted file mode 100644 index 487fac7..0000000 --- a/manuals/chickadee/Rectangles.html +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - -Rectangles (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Math   [Contents][Index]

-
-
-

5.2.3 Rectangles

- -

The (chickadee math rect) module provides an API for -manipulating axis-aligned bounding boxes (AABBs). AABBs are often -used for collision detection in games. Common use-cases are defining -“hitboxes” in platformers or using them for the “broad phase” of a -collision detection algorithm that uses a more complex (and thus -slower) method of determining the actual collisions. -

-

Like some of the other math modules, there exists a collection of -functions that do in-place modification of rectangles for use in -performance critical code paths. -

-
-
Procedure: rect x y width height
-
Procedure: make-rect x y width height
-

Create a new rectangle that is width by height in size and -whose bottom-left corner is located at (x, y). -

- -
-
Procedure: rect? obj
-

Return #t if obj is a rectangle. -

- -
-
Procedure: rect-within? rect1 rect2
-

Return #t if rect2 is completely within rect1. -

- -
-
Procedure: rect-intersects? rect1 rect2
-

Return #t if rect2 overlaps rect1. -

- -
-
Procedure: rect-contains? rect x y
-

Return #t if the coordinates (x, y) are within -rect. -

- -
-
Procedure: rect-contains-vec2? rect v
-

Return #t if the 2D vector v is within the bounds of -rect. -

- -
-
Procedure: rect-x rect
-

Return the X coordinate of the lower-left corner of rect. -

- -
-
Procedure: rect-y rect
-

Return the Y coordinate of the lower-left corner of rect. -

- -
-
Procedure: rect-left rect
-

Return the left-most X coordinate of rect. -

- -
-
Procedure: rect-right rect
-

Return the right-most X coordinate of rect. -

- -
-
Procedure: rect-bottom rect
-

Return the bottom-most Y coordinate of rect. -

- -
-
Procedure: rect-top rect
-

Return the top-most Y coordinate of rect. -

- -
-
Procedure: rect-center-x rect
-

Return the X coordinate of the center of rect. -

- -
-
Procedure: rect-center-y rect
-

Return the Y coordinate of the center of rect. -

- -
-
Procedure: rect-width rect
-

Return the width of rect. -

- -
-
Procedure: rect-height rect
-

Return the height of rect. -

- -
-
Procedure: rect-area rect
-

Return the surface area covered by rect. -

- -
-
Procedure: rect-clamp-x rect x
-

Restrict x to the portion of the X axis covered by rect. -

- -
-
Procedure: rect-clamp-y rect y
-

Restrict y to the portion of the Y axis covered by rect. -

- -
-
Procedure: rect-clamp rect1 rect2
-

Return a new rect that adjusts the location of rect1 so that it -is completely within rect2. An exception is thrown in the case -that rect1 cannot fit completely within rect2. -

- -
-
Procedure: rect-move rect x y
-

Return a new rectangle based on rect but moved to the -coordinates (x, y). -

- -
-
Procedure: rect-move-vec2 rect v
-

Return a new rectangle based on rect but moved to the -coordinates in the 2D vector v. -

- -
-
Procedure: rect-move-by rect x y
-

Return a new rectangle based on rect but moved by (x, -y) units relative to its current location. -

- -
-
Procedure: rect-move-by-vec2 rect v
-

Return a new rectangle based on rect but moved by the 2D vector -v relative to its current location. -

- -
-
Procedure: rect-inflate rect width height
-

Return a new rectangle based on rect, but expanded by -width units on the X axis and height units on the Y axis, -while keeping the rectangle centered on the same point. -

- -
-
Procedure: rect-union rect1 rect2
-

Return a new rectangle that completely covers the area of rect1 -and rect2. -

- -
-
Procedure: rect-clip rect1 rect2
-

Return a new rectangle that is the overlapping region of rect1 -and rect2. If the two rectangles do not overlap, a rectangle of -0 width and 0 height is returned. -

- -
-
Procedure: set-rect-x! rect x
-

Set the left X coordinate of rect to x. -

- -
-
Procedure: set-rect-y! rect y
-

Set the bottom Y coordinate of rect to y. -

- -
-
Procedure: set-rect-width! rect width
-

Set the width of rect to width. -

- -
-
Procedure: set-rect-height! rect height
-

Set the height of rect to height. -

- -
-
Procedure: rect-move! rect x y
-

Move rect to (x, y) in-place. -

- -
-
Procedure: rect-move-vec2! rect v
-

Move rect to the 2D vector v in-place. -

- -
-
Procedure: rect-move-by! rect x y
-

Move rect by (x, y) in-place. -

- -
-
Procedure: rect-move-by-vec2! rect v
-

Move rect by the 2D vector v in-place. -

- -
-
Procedure: rect-inflate! rect width height
-

Expand rect by width and height in-place. -

- -
-
Procedure: rect-union! rect1 rect2
-

Modify rect1 in-place to completely cover the area of both -rect1 and rect2. -

- -
-
Procedure: rect-clip! rect1 rect2
-

Modify rect1 in-place to be the overlapping region of -rect1 and rect2. -

- -
-
Procedure: rect-clamp! rect1 rect2
-

Adjust the location of rect1 in-place so that its bounds are -completely within rect2. An exception is thrown in the case -that rect1 cannot fit completely within rect2. -

- -
-
Procedure: vec2-clamp-to-rect! v rect
-

Restrict the coordinates of the 2D vector v so that they are -within the bounds of rect. v is modified in-place. -

- -
-
-

-Next: , Previous: , Up: Math   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Render-Settings.html b/manuals/chickadee/Render-Settings.html deleted file mode 100644 index 66c0eb7..0000000 --- a/manuals/chickadee/Render-Settings.html +++ /dev/null @@ -1,512 +0,0 @@ - - - - - - -Render Settings (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
-
-

5.3.16 Render Settings

- -

5.3.16.1 Blending

- -

Rendering a scene often involves drawing layers of objects that -overlap each other. Blending determines how two overlapping pixels -are combined in the final image that is rendered to the screen. The -(chickadee graphics blend) module provides a data type for -blending modes. -

-

Chickadee provides the following blend modes: -

-
-
Variable: blend:alpha
-

Blend pixels according to the values of their alpha channels. This is -the most commonly used blend mode. -

- -
-
Variable: blend:replace
-

Overwrite the output pixel color with the color being drawn. -

- -
-
Variable: blend:add
-

Add all pixel color values together. The more colors blended -together, the more white the final color becomes. -

- -
-
Variable: blend:subtract
-

Subtract all pixel color values. The more colors blended together, -the more black the final color becomes. -

- -
-
Variable: blend:multiply
-
- -
-
Variable: blend:darken
-
- -
-
Variable: blend:lighten
-
- -
-
Variable: blend:screen
-
- -

Custom blend modes can be created using the make-blend-mode procedure: -

-
-
Procedure: make-blend-mode equation source-function destination-function
-

Return a new custom blend mode that applies source-function to -the source color, destination-function to the destination color, -and finally applies equation to the transformed -source/destination color values. These arguments are not -procedures, but symbolic representations of the functions that OpenGL -supports. -

-

Valid values for equation are: -

-
    -
  • add -
  • subtract -
  • reverse-subtract -
  • min -
  • max -
  • alpha-min -
  • alpha-max -
- -

Valid values for source-function are: -

-
    -
  • zero -
  • one -
  • destination-color -
  • one-minus-destination-color -
  • source-alpha-saturate -
  • source-alpha -
  • one-minus-source-alpha -
  • destination-alpha -
  • one-minus-destination-alpha -
  • constant-color -
  • one-minus-constant-color -
  • constant-alpha -
  • one-minus-constant-alpha -
- -

Valid values for destination-function are: -

-
    -
  • zero -
  • one -
  • source-color -
  • one-minus-source-color -
  • source-alpha -
  • one-minus-source-alpha -
  • destination-alpha -
  • one-minus-destination-alpha -
  • constant-color -
  • one-minus-constant-color -
  • constant-alpha -
  • one-minus-constant-alpha -
- -
- -

5.3.16.2 Polygon Modes and Culling

- -

The (chickadee graphics polygon) module provides access to the -g:polygon-mode and g:cull-face-mode render states. -

-
-
Variable: fill-polygon-mode
-

Completely fill in the polygon. This is the default mode. -

- -
-
Variable: line-polygon-mode
-

Render only the edges of the polygon. Produces a wireframe. -

- -
-
Variable: point-polygon-mode
-

Render only the vertex positions as points. -

- -
-
Procedure: make-polygon-mode front back
-

Return a new polygon mode that uses the method front for the -front face and back for the back face. The valid modes are -fill, line, and point. -

- -
-
Procedure: polygon-mode? obj
-

Return #t if obj is a polygon mode. -

- -
-
Procedure: current-polygon-mode
-

Return the current polygon mode. -

- -
-
Variable: g:polygon-mode
-

Render state for polygon modes (see Rendering Engine.) -

- -
-
Variable: no-cull-face-mode
-

Don’t cull any faces. -

- -
-
Variable: back-cull-face-mode
-

Cull only back faces. -

- -
-
Variable: front-cull-face-mode
-

Cull only front faces. -

- -
-
Variable: front-and-back-cull-face-mode
-

Cull both front and back faces. -

- -
-
Procedure: cull-face-mode? obj
-

Return #t if obj is a cull face mode. -

- -
-
Procedure: cull-face-mode-front? cull-face-mode
-

Return #t if cull-face-mode culls front faces. -

- -
-
Procedure: cull-face-mode-back? cull-face-mode
-

Return #t if cull-face-mode culls back faces. -

- -
-
Procedure: current-cull-face-mode
-

Return the current cull face mode. -

- -
-
Variable: g:cull-face-mode
-

Render state for cull face modes (see Rendering Engine.) -

- -

5.3.16.3 Depth Testing

- -

The (chickadee graphics depth) module provides access to the -g:depth-test render state. -

-
-
Procedure: make-depth-test [#:write? #t] [#:function 'less-than] [#:near 0.0] [#:far 1.0]
-
-

Return a new depth test object. If write is #t, the -depth buffer will be written to during a draw call. near and -far define the min/max Z values for which depth testing may -pass. -

-

function specifies how the depth value of pixel being drawn -compares to the depth value that is already in the depth buffer. When -this comparison is true, the depth test passes and the pixel is drawn. -When it fails, the pixel is discarded. -

-

The possible values of function are: -

-
    -
  • always -
  • never -
  • equal -
  • not-equal -
  • less-than -
  • less-than-or-equal -
  • greater-than -
  • greater-than-or-equal -
- -
- -
-
Procedure: depth-test? obj
-

Return #t when obj is a depth test object. -

- -
-
Procedure: depth-test-write? depth-test
-

Return #t when depth-test will write to the depth buffer. -

- -
-
Procedure: depth-test-function depth-test
-

Return the comparison function of depth-test. -

- -
-
Procedure: depth-test-near depth-test
-

Return the near Z value of depth-test. -

- -
-
Procedure: depth-test-far depth-test
-

Return the far Z value of depth-test. -

- -
-
Procedure: current-depth-test
-

Return the current depth test. -

- -
-
Variable: g:depth-test
-

Render state for depth tests (see Rendering Engine.) -

- -

5.3.16.4 Stencil Testing

- -

The (chickadee graphics stencil) module provides access to the -g:stencil-test render state. -

-
-
Variable: default-stencil-test
-

A stencil test that always passes. -

- -
-
Procedure: make-stencil-test [#:mask #xFF] [#:function always] [#:function-mask #xFF] [#:reference 0] [#:on-fail keep] [#:on-depth-fail keep] [#:on-pass keep] [#:mask-front mask] [#:mask-back mask] [#:function-mask-front function-mask] [#:function-mask-back function-mask] [#:refrence-front reference] [#:reference-back reference] [#:on-fail-front on-fail] [#:on-fail-back on-fail] [#:on-depth-fail-front on-depth-fail] [#:on-depth-fail-back on-depth-fail] [#:on-pass-front on-pass] [#:on-pass-back on-pass]
-
-

Return a new stencil test object. Different configurations can be -used for the front and back faces by using the arguments that end in -“front” or “back”. -

-

Valid values for on-pass, on-fail, and on-depth-fail -are: -

-
    -
  • zero -
  • keep -
  • replace -
  • increment -
  • increment-wrap -
  • decrement -
  • decrement-wrap -
  • invert -
- -

Valid values for function are: -

-
    -
  • always -
  • never -
  • equal -
  • not-equal -
  • less-than -
  • less-than-or-equal -
  • greater-than -
  • greater-than-or-equal -
- -
- -
-
Procedure: stencil-test? obj
-

Return #t when obj is a stencil test object. -

- -
-
Procedure: stencil-test-mask-front stencil-test
-

Return the front mask of stencil-test. -

- -
-
Procedure: stencil-test-mask-back stencil-test
-

Return the back mask of stencil-test. -

- -
-
Procedure: stencil-test-function-front stencil-test
-

Return the front function of stencil-test. -

- -
-
Procedure: stencil-test-function-back stencil-test
-

Return the back function of stencil-test. -

- -
-
Procedure: stencil-test-function-mask-front stencil-test
-

Return the front function-mask of stencil-test. -

- -
-
Procedure: stencil-test-function-mask-back stencil-test
-

Return the back function-mask of stencil-test. -

- -
-
Procedure: stencil-test-reference-front stencil-test
-

Return the front reference value of stencil-test. -

- -
-
Procedure: stencil-test-reference-back stencil-test
-

Return the back reference value of stencil-test. -

- -
-
Procedure: stencil-test-on-fail-front stencil-test
-

Return the front failure action of stencil-test. -

- -
-
Procedure: stencil-test-on-fail-back stencil-test
-

Return the back failure action of stencil-test. -

- -
-
Procedure: stencil-test-on-depth-fail-front stencil-test
-

Return the front depth test failure action of stencil-test. -

- -
-
Procedure: stencil-test-on-depth-fail-back stencil-test
-

Return the back depth test failure action of stencil-test. -

- -
-
Procedure: stencil-test-on-pass-front stencil-test
-

Return the front pass action of stencil-test. -

- -
-
Procedure: stencil-test-on-pass-back stencil-test
-

Return the back pass action of stencil-test. -

- -
-
Procedure: current-stencil-test
-

Return the current stencil test. -

- -
-
Variable: g:stencil-test
-

Render state for stencil testing (see Rendering Engine.) -

- -

5.3.16.5 Multisample Antialiasing

- -

Multisample antialiasing is a feature supported by many, but not all, -graphics cards. It is a nice easy way to improve the final frame that -the user sees, particularly in 3D scenes. The (chickadee -graphics multisample) module provides access to the -g:multisample? render state. -

-
-
Procedure: current-multisample
-

Return #t if multisampling is enabled. -

- -
-
Variable: g:multisample?
-

Render state for multisampling (see Rendering Engine.) -

- -
-
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Rendering-Engine.html b/manuals/chickadee/Rendering-Engine.html deleted file mode 100644 index 8f81fc6..0000000 --- a/manuals/chickadee/Rendering-Engine.html +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - -Rendering Engine (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Previous: , Up: Graphics   [Contents][Index]

-
-
-

5.3.17 Rendering Engine

- -

The (chickadee graphics engine) module provides a Scheme -abstraction to the state of the GPU driver. When the Chickadee game -loop launches, it takes care to initialize the engine. All draw calls -and state changes happen within the context of this engine. -

-

Performing a custom draw call could look something like this: -

-
-
(with-graphics-state ((g:blend-mode blend:alpha)
-                      (g:texture-0 my-texture))
-  (shader-apply my-shader #:foo 1))
-
- -

5.3.17.1 Render States

- -

Render states represent individual state values on the GPU. For -example, the current shader. As a naming convention, Chickadee -prefixes variables containing render states with g:. Render -states can be manipulated using the with-graphics-state macro. -

-
-
Syntax: with-graphics-state ((name value) …) body …
-

Evaluate body with render states defined by name changed -to value. The render states are restored to their previous -values afterwards. -

- -

One additional piece of state that the rendering engine has, that is -not part of the GPU state, is the current projection matrix: -

-
-
Procedure: current-projection
-

Return the currently bound projection matrix (see Matrices). -

- -
-
Syntax: with-projection projection body …
-

Evaluate body with the current projection matrix bound to -projection (see Matrices). -

- -

5.3.17.2 Rendering

- -

Chickadee likens a GPU draw call to a Scheme procedure call. A shader -(see Shaders) is like a procedure for the GPU to apply. Shaders -are passed arguments: The positional arguments are vertex array -attributes (see Buffers) and the keyword arguments correspond to -the shader’s uniform variables. Scheme uses apply to call a -procedure, so Chickadee uses shader-apply to call a shader. -

-
-
Syntax: shader-apply shader vertex-array [#:uniform-key uniform-value …]
-
Syntax: shader-apply* shader vertex-array count [#:uniform-key uniform-value …]
-
-

Render vertex-array using shader with the uniform values -specified in the following keyword arguments. -

-

While shader-apply will draw every vertex in vertex-array, -shader-apply* will only draw count vertices. -

- -
-
Syntax: shader-apply/instanced shader vertex-array n [#:uniform-key uniform-value …]
-
Syntax: shader-apply/instanced shader vertex-array count n [#:uniform-key uniform-value …]
-
-

Render vertex-array n times using shader with the -uniform values specified in the following keyword arguments. -

-

Instanced rendering is very beneficial for rendering the same object -many times with only small differences for each one. For example, the -particle effects described in Particles use instanced rendering. -

-

While shader-apply/instanced will draw every vertex in -vertex-array, shader-apply* will only draw count -vertices. -

- -
-
-

-Previous: , Up: Graphics   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Requirements.html b/manuals/chickadee/Requirements.html deleted file mode 100644 index 1093943..0000000 --- a/manuals/chickadee/Requirements.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - -Requirements (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Up: Installation   [Contents][Index]

-
-
-

1.1 Requirements

- -

Chickadee depends on the following packages: -

- - - - - - - diff --git a/manuals/chickadee/Scripting.html b/manuals/chickadee/Scripting.html deleted file mode 100644 index 2ef1b5b..0000000 --- a/manuals/chickadee/Scripting.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - -Scripting (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: API Reference   [Contents][Index]

-
-
-

5.5 Scripting

- -

Game logic is a web of asynchronous events that are carefully -coordinated to bring the game world to life. In order to make an -enemy follow and attack the player, or move an NPC back and forth in -front of the item shop, or do both at the same time, a scripting -system is a necessity. Chickadee comes with an asynchronous -programming system in the (chickadee scripting) module. -Lightweight, cooperative threads known as “scripts” allow the -programmer to write asynchronous code as if it were synchronous, and -allow many such “threads” to run concurrently. -

-

But before we dig deeper into scripts, let’s discuss the simple act -of scheduling tasks. -

- - - - - - - - - - - - diff --git a/manuals/chickadee/Scripts.html b/manuals/chickadee/Scripts.html deleted file mode 100644 index b62bb2d..0000000 --- a/manuals/chickadee/Scripts.html +++ /dev/null @@ -1,212 +0,0 @@ - - - - - - -Scripts (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Scripting   [Contents][Index]

-
-
-

5.5.2 Scripts

- -

Now that we can schedule tasks, let’s take things to the next level. -It sure would be great if we could make procedures that described a -series of actions that happened over time, especially if we could do -so without contorting our code into a nest of callback procedures. -This is where scripts come in. With scripts we can write code in a -linear way, in a manner that appears to be synchronous, but with the -ability to suspend periodically in order to let other scripts have a -turn and prevent blocking the game loop. Building on top of the -scheduling that agendas provide, here is a script that models a child -trying to get their mother’s attention: -

-
-
(script
-  (while #t
-    (display "mom!")
-    (newline)
-    (sleep 60))) ; where 60 = 1 second of real time
-
- -

This code runs in an endless loop, but the sleep procedure -suspends the script and schedules it to be run later by the agenda. -So, after each iteration of the loop, control is returned back to the -game loop and the program is not stuck spinning in a loop that will -never exit. Pretty neat, eh? -

-

Scripts can suspend to any capable handler, not just the agenda. -The yield procedure will suspend the current script and pass -its “continuation” to a handler procedure. This handler procedure -could do anything. Perhaps the handler stashes the continuation -somewhere where it will be resumed when the user presses a specific -key on the keyboard, or maybe it will be resumed when the player picks -up an item off of the dungeon floor; the sky is the limit. -

-

Sometimes it is necessary to abruptly terminate a script after it has -been started. For example, when an enemy is defeated their AI routine -needs to be shut down. When a script is spawned, a handle to that -script is returned that can be used to cancel it when desired. -

-
-
(define script (script (while #t (display "hey\n") (sleep 60))))
-;; sometime later
-(cancel-script script)
-
- -
-
Procedure: spawn-script thunk
-

Apply thunk as a script and return a handle to it. -

- -
-
Syntax: script body …
-

Evaluate body as a script and return a handle to it. -

- -
-
Procedure: script? obj
-

Return #t if obj is a script handle. -

- -
-
Procedure: script-cancelled? obj
-

Return #t if obj has been cancelled. -

- -
-
Procedure: script-running? obj
-

Return #t if obj has not yet terminated or been -cancelled. -

- -
-
Procedure: script-complete? obj
-

Return #t if obj has terminated. -

- -
-
Procedure: cancel-script co
-

Prevent further execution of the script co. -

- -
-
Procedure: yield handler
-

Suspend the current script and pass its continuation to the -procedure handler. -

- -
-
Procedure: join script
-

Suspend the current script until script has terminated. -

- -
-
Procedure: sleep duration
-

Wait duration before resuming the current script. -

- -
-
Syntax: wait-until condition
-

Wait until condition is met before resuming the current script. -

-
-
(script
-  (wait-until (key-pressed? 'z))
-  (display "you pressed the Z key!\n"))
-
- -
- -
-
Syntax: forever body …
-

Evaluate body in an endless loop. -

- -
-
-

-Next: , Previous: , Up: Scripting   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Shaders.html b/manuals/chickadee/Shaders.html deleted file mode 100644 index 505e031..0000000 --- a/manuals/chickadee/Shaders.html +++ /dev/null @@ -1,405 +0,0 @@ - - - - - - -Shaders (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
-
-

5.3.13 Shaders

- -

Shaders are programs that the GPU can evaluate that allow the -programmer to completely customized the final output of a GPU draw -call. The (chickadee graphics shader) module provides an API for -building custom shaders. -

-

Shaders are written in the OpenGL Shading Language, or GLSL for short. -Chickadee aspires to provide a domain specific language for writing -shaders in Scheme, but we are not there yet. -

-

Shader programs consist of two components: A vertex shader and a -fragment shader. A vertex shader receives vertex data (position -coordinates, texture coordinates, normals, etc.) and transforms them -as desired, whereas a fragment shader controls the color of each -pixel. -

-

Sample vertex shader: -

-
-
#version 130
-
-in vec2 position;
-in vec2 tex;
-out vec2 fragTex;
-uniform mat4 mvp;
-
-void main(void) {
-    fragTex = tex;
-    gl_Position = mvp * vec4(position.xy, 0.0, 1.0);
-}
-
- -

Sample fragment shader: -

-
-
#version 130
-
-in vec2 fragTex;
-uniform sampler2D colorTexture;
-
-void main (void) {
-    gl_FragColor = texture2D(colorTexture, fragTex);
-}
-
- -

This manual will not cover GLSL features and syntax as there is lots -of information already available about this topic. -

-

One way to think about rendering with shaders, and the metaphor -Chickadee uses, is to think about it as a function call: The shader is -a function, and it is applied to some “attributes” (positional -arguments), and some “uniforms” (keyword arguments). -

-
-
(define my-shader (load-shader "vert.glsl" "frag.glsl"))
-(define vertices (make-vertex-array ...))
-(shader-apply my-shader vertices #:color red)
-
- -

See Rendering Engine for more details about the shader-apply -procedure. -

-

Shaders are incredibly powerful tools, and there’s more information -about them than we could ever fit into this manual, so we highly -recommend searching the web for more information and examples. What -we can say, though, is how to use our API: -

-
-
Procedure: strings->shader vertex-source fragment-source
-

Compile vertex-source, the GLSL code for the vertex shader, and -fragment-source, the GLSL code for the fragment shader, into a -GPU shader program. -

- -
-
Procedure: load-shader vertex-source-file fragment-source-file
-

Compile the GLSL source code within vertex-source-file and -fragment-source-file into a GPU shader program. -

- -
-
Procedure: make-shader vertex-port fragment-port
-

Read GLSL source from vertex-port and fragment-port and -compile them into a GPU shader program. -

- -
-
Procedure: shader? obj
-

Return #t if obj is a shader. -

- -
-
Variable: null-shader
-

Represents the absence shader program. -

- -
-
Procedure: shader-uniform shader name
-

Return the metadata for the uniform name in shader. -

- -
-
Procedure: shader-uniforms shader
-

Return a hash table of uniforms for shader. -

- -
-
Procedure: shader-attributes shader
-

Return a hash table of attributes for shader. -

- -
-
Procedure: shader-uniform-set! shader uniform value
-
- -

5.3.13.1 Attributes

- -
-
Procedure: attribute? obj
-

Return #t if obj is an attribute. -

- -
-
Procedure: attribute-name attribute
-

Return the variable name of attribute. -

- -
-
Procedure: attribute-location attribute
-

Return the binding location of attribute. -

- -
-
Procedure: attribute-type attribute
-

Return the data type of attribute. -

- -

5.3.13.2 Uniforms

- -
-
Procedure: uniform? obj
-

Return #t if obj is a uniform. -

- -
-
Procedure: uniform-name uniform
-

Return the variable name of uniform. -

- -
-
Procedure: uniform-type uniform
-

Return the data type of uniform. -

- -
-
Procedure: uniform-value uniform
-

Return the current value of uniform. -

- -

5.3.13.3 User-Defined Shader Types

- -

The shader examples in this manual thus far have only shown uniforms -defined using primitive types. However, GLSL shaders support -user-defined compound structs, such as this one: -

-
-
struct Light {
-  bool enabled;
-  int type;
-  vec3 position;
-  vec3 direction;
-  vec4 color;
-  float intensity;
-  float cutOff;
-};
-
-uniform Light light;
-
- -

While light is declared as a single uniform in the shader code, -OpenGL translates this into seven uniforms in this case: One -uniform each member of the Light struct. This poses a problem -for sending Scheme data to the GPU. How can compound Scheme data -translate into compound uniform data on the GPU? The answer is with -shader types. Shader types are a special kind of Guile struct that -provide a one-to-one mapping between a Scheme data structure and a -shader struct. -

-

Some example code will explain this concept best. Here is the Scheme -equivalent of the Light struct: -

-
-
(define-shader-type <light>
-  make-light
-  light?
-  (bool enabled light-enabled?)
-  (int type light-type)
-  (float-vec3 position light-position)
-  (float-vec3 direction light-direction)
-  (float-vec4 color light-color)
-  (float intensity light-intensity)
-  (float cut-off light-cut-off))
-
- -

The macro define-shader-type closely resembles the familiar -define-record-type from SRFI-9, but with one notable -difference: Each struct field contains type information. The type -must be one of several primitive types (documented below) or another -shader type in the case of a nested structure. -

-

It is important to note that the names of the shader type fields -must match the names of the struct members in the GLSL code, -otherwise Chickadee will be unable to perform the proper translation. -

-

As of this writing, this interface is new and experimental. It -remains to be seen if this model is robust enough for all use-cases. -

-

Primitive data types: -

-
-
Variable: bool
-

Either #t or #f. -

- -
-
Variable: int
-

An integer. -

- -
-
Variable: unsigned-int
-

An unsigned integer. -

- -
-
Variable: float
-

A floating point number. -

- -
-
Variable: float-vec2
-

A 2D vector (see Vectors.) -

- -
-
Variable: float-vec3
-

A 3D vector (see Vectors.) -

- -
-
Variable: float-vec4
-

A color (see Colors) or rectangle (see Rectangles.) -

- -
-
Variable: mat3
-

A 3x3 matrix (see Matrices.) -

- -
-
Variable: mat4
-

A 4x4 matrix (see Matrices.) -

- -
-
Variable: sampler-2d
-

A texture (see Textures.) -

- -
-
Variable: sampler-cube
-

A cube map (see Textures.) -

- -
-
Variable: local-field
-

A special type that means that the data is for the client-side -(Scheme-side) only and should not be sent to the GPU. Any object may -be stored in a local field. -

- -
-
Syntax: define-shader-type <name> constructor predicate (field-type field-name [field-getter] [field-setter]) …
-
-

Define a new shader data type called <name>. -

-

Instances of this data type are created by calling the -constructor procedure. This procedure maps each field to a -keyword argument. A shader data type with the fields foo, -bar, and baz would have a constructor that accepts the -keyword arguments #:foo, #:bar, and #:baz. -

-

A procedure named predicate will test if an object is a -<name> shader data type. -

-

Fields follow the format (field-type field-name [field-getter] -[field-setter]). field-type and field-name are required -for each field, but field-getter and field-setter are -optional. -

-
- -
-
Procedure: shader-data-type? obj
-

Return #t if obj is a shader data type object. -

- -
-
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Skyboxes.html b/manuals/chickadee/Skyboxes.html deleted file mode 100644 index 07cc5d6..0000000 --- a/manuals/chickadee/Skyboxes.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - -Skyboxes (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
-
-

5.3.10 Skyboxes

- -

Skyboxes are used as backgrounds in 3D environments, as well as a -source of ambient lighting data when rendering 3D objects. The -(chickadee graphics skybox) module provides an API for making -skyboxes. -

-
-
Procedure: make-skybox cube-map
-

Return a new skybox that uses cube-map for a texture. -

- -
-
Procedure: skybox? obj
-

Return #t if obj is a skybox. -

- -
-
Procedure: skybox-cube-map sky-box
-

Return the cube map of skybox. -

- -
-
Procedure: draw-skybox skybox view
-

Render skybox to the screen using the view matrix view. -

- - - - - - diff --git a/manuals/chickadee/Sources.html b/manuals/chickadee/Sources.html deleted file mode 100644 index cca3b56..0000000 --- a/manuals/chickadee/Sources.html +++ /dev/null @@ -1,336 +0,0 @@ - - - - - - -Sources (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Audio   [Contents][Index]

-
-
-

5.4.2 Sources

- -

While the audio-play procedure provides a quick and convenient -way to play audio, it has some limitations. What if the audio is a -long piece of music that might need to be paused or stopped later? -What if the audio should be looped? What if the volume or pitch needs -to be altered? For manipulating audio in these ways, a “source” is -required. Sources can be thought of like a boombox: They sit -somewhere in the room and play sound. The pause or stop buttons can -be pressed; it can be moved somewhere else; the volume knob can be -adjusted; the CD can be changed. -

-

Sources are a great fit for handling background music, among other -things. For quick, one-off sound effects, audio-play is a -better fit. -

-
-
Procedure: make-source audio loop? [#:pitch 1.0] [#:volume 1.0] [#:min-volume 0.0] [#:max-volume 1.0] [#:max-distance] [#:reference-distance 0.0] [#:rolloff-factor 1.0] [#:cone-outer-volume 0.0] [#:cone-inner-angle 0.0] [#:cone-outer-angle] [#:position (vec3 0.0 0.0 0.0)] [#:velocity (vec3 0.0 0.0 0.0)] [#:direction (vec3 0.0 0.0 0.0)] [#:relative? #f]
-
-

Return a new audio source. audio is the audio data to use when -playing. loop? specifies whether or not to loop the audio -during playback. -

-

Refer to audio-play (see Audio Files) for information about -the optional keyword arguments. -

- -
-
Procedure: source? obj
-

Return #t if obj is an audio source object. -

- -
-
Procedure: streaming-source? source
-

Return #t if source contains streaming audio. -

- -
-
Procedure: static-source? source
-

Return #t if source contains static audio. -

- -
-
Procedure: source-playing? source
-

Return #t if source is currently playing. -

- -
-
Procedure: source-paused? source
-

Return #t if source is currently paused. -

- -
-
Procedure: source-stopped? source
-

Return #t if source is currently stopped. -

- -
-
Procedure: source-pitch source
-

Return the pitch multiplier of source. -

- -
-
Procedure: source-volume source
-

Return the volume multiplier of source. -

- -
-
Procedure: source-min-volume source
-

Return the minimum volume of source. -

- -
-
Procedure: source-max-volume source
-

Return the maximum volume of source. -

- -
-
Procedure: source-max-distance source
-

Return the maximum distance of source. -

- -
-
Procedure: source-reference-distance source
-

Return the reference distance of source. -

- -
-
Procedure: source-rolloff-factor source
-

Return the rolloff factor of source. -

- -
-
Procedure: source-cone-outer-volume source
-

Return the volume of source when outside the oriented cone. -

- -
-
Procedure: source-cone-inner-angle source
-

Return the inner angle of the sound cone of source in radians. -

- -
-
Procedure: source-cone-outer-angle source
-

Return the outer angle of the sound cone of source in radians. -

- -
-
Procedure: source-position source
-

Return the position of source as a 3D vector. -

- -
-
Procedure: source-velocity source
-

Return the velocity of source as a 3D vector. -

- -
-
Procedure: source-direction source
-

Return the direction of source as a 3D vector. -

- -
-
Procedure: source-relative? source
-

Return #t if the position of source is relative to the -listener’s position. -

- -
-
Procedure: source-play source
-

Begin/resume playback of source. -

- -
-
Procedure: source-pause source
-

Pause playback of source. -

- -
-
Procedure: source-toggle source
-

Play source if it is currently paused or pause source if -it is currently playing. -

- -
-
Procedure: source-stop [source]
-

Stop playing source or, if no source is specified, stop playing -all sources. -

- -
-
Procedure: source-rewind source
-

Rewind source to the beginning of the audio stream. -

- -
-
Procedure: set-source-audio! source audio
-

Set the playback stream for source to audio. -

- -
-
Procedure: set-source-loop! source loop?
-

Configure whether or not source should loop the audio stream. -

- -
-
Procedure: set-source-pitch! source pitch
-

Set the pitch multiplier of source to pitch -

- -
-
Procedure: set-source-volume! source volume
-

Set the volume of source to volume. A value of 1.0 is -100% volume. -

- -
-
Procedure: set-source-min-volume! source volume
-

Set the minimum volume of source to volume. -

- -
-
Procedure: set-source-max-volume! source volume
-

Set the maximum volume of source to volume. -

- -
-
Procedure: set-source-max-distance! source distance
-

Set the distance where there will no longer be any attenuation of -source to distance. -

- -
-
Procedure: set-source-reference-distance! source distance
-

Set the reference distance of source to distance. -

- -
-
Procedure: set-source-rolloff-factor! source factor
-

Set the rolloff factor for source to factor. -

- -
-
Procedure: set-source-cone-outer-volume! source volume
-

Set the volume for source when outside the sound cone to volume. -

- -
-
Procedure: set-source-cone-inner-angle! source angle
-

Set the inner angle of the sound cone of source to angle radians. -

- -
-
Procedure: set-source-cone-outer-angle! source angle
-

Set the outer angle of the sound cone of source to angle radians. -

- -
-
Procedure: set-source-position! source position
-

Set the position of source to the 3D vector position. -

- -
-
Procedure: set-source-velocity! source velocity
-

Set the velocity of source to the 3D vector velocity. -

- -
-
Procedure: set-source-direction! source direction
-

Set the velocity of source to the 3D vector direction. -

- -
-
Procedure: set-source-relative! source relative?
-

If relative? is #t, the position of source is -interpreted as relative to the listener’s position. Otherwise, the -position of source is in absolute coordinates. -

- -
-
-

-Next: , Previous: , Up: Audio   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Sprites.html b/manuals/chickadee/Sprites.html deleted file mode 100644 index 3d045ba..0000000 --- a/manuals/chickadee/Sprites.html +++ /dev/null @@ -1,233 +0,0 @@ - - - - - - -Sprites (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
-
-

5.3.3 Sprites

- -

For those who are new to this game, a sprite is a 2D rectangular -bitmap that is rendered to the screen. For 2D games, sprites are the -most essential graphical abstraction. They are used for drawing maps, -players, NPCs, items, particles, text, etc. -

-

In Chickadee, the (chickadee graphics sprite) module provides the -interface for working with sprites. Bitmaps are stored in textures -(see Textures) and can be used to draw sprites via the -draw-sprite procedure. -

-
-
Procedure: draw-sprite texture position [#:blend-mode] [#:origin] [#:rect] [#:rotation] [#:scale] [#:shear] [#:tint white]
-
-

Draw texture at position. -

-

Optionally, other transformations may be applied to the sprite. -rotation specifies the angle to rotate the sprite, in radians. -scale specifies the scaling factor as a 2D vector. shear -specifies the shearing factor as a 2D vector. All transformations are -applied relative to origin, a 2D vector, which defaults to the -lower-left corner. -

-

tint specifies the color to multiply against all the sprite’s -pixels. By default white is used, which does no tinting at all. -

-

Alpha blending is used by default but the blending method can be -changed by specifying blend-mode. -

-

The area drawn to is as big as the texture, by default. To draw to an -arbitrary section of the screen, specify rect. -

- -

5.3.3.1 Sprite Batches

- -

It’s not uncommon to need to draw hundreds or thousands of sprites -each frame. However, GPUs (graphics processing units) are tricky -beasts that prefer to be sent few, large chunks of data to render -rather than many, small chunks. Using draw-sprite on its own -will involve at least one GPU call per sprite. This is fine -for rendering a few dozen sprites, but will become a serious -bottleneck when rendering hundreds or thousands of sprites. To deal -with this, a technique known as “sprite batching” is used. Instead -of drawing each sprite immediately, the sprite batch will build up a -large buffer of sprites to draw and send them to the GPU all at once. -There is one caveat, however. Batching only works if the sprites -being drawn share a common texture. A good strategy for reducing the -number of different textures is to stuff many bitmaps into a single -image file and create a “texture atlas” (see Textures) to access -the sub-images within. -

-
-
Procedure: make-sprite-batch texture [#:capacity 256]
-

Create a new sprite batch for texture with initial space for -capacity sprites. Sprite batches automatically resize when they -are full to accomodate as many sprites as necessary. -

- -
-
Procedure: sprite-batch? obj
-

Return #t if obj is a sprite batch. -

- -
-
Procedure: sprite-batch-texture batch
-

Return the texture for batch. -

- -
-
Procedure: set-sprite-batch-texture! batch texture
-

Set texture for batch to texture. -

- -
-
Procedure: sprite-batch-add! batch position [#:origin] [:rotation] [#:scale] [#:shear] [#:texture-region] [#:tint white]
-
-

Add sprite located at position to batch. -

-

To render a subsection of the batch’s texture, a texture object whose -parent is the batch texture may be specified as texture-region. -

-

See draw-sprite for information about the other arguments. -

- -
-
Procedure: sprite-batch-clear! batch
-

Reset size of batch to 0. -

- -
-
Procedure: draw-sprite-batch batch [#:blend-mode]
-

Render batch using blend-mode. Alpha blending is used by -default. -

- -

5.3.3.2 9-Patches

- -

A 9-patch is a method of rendering a texture so that it can be -stretched to cover an area of any size without becoming distorted. -This is achieved by dividing up the sprite into nine regions: -

- - -

The most common application of this technique is for graphical user -interface widgets like buttons and dialog boxes which are often -dynamically resizable. By using a 9-patch, they can be rendered at -any size without scaling artifacts. The (chickadee graphics -9-patch) module provides this functionality. -

-
-
Procedure: draw-9-patch texture rect [#:margin 0] [#:top-margin margin] [#:bottom-margin margin] [#:left-margin margin] [#:right-margin margin] [#:mode stretch] [#:origin] [#:scale] [#:rotation] [#:blend-mode] [#:tint white]
-
-

Draw a 9-patch over the area rect using texture whose -stretchable/tileable patches are defined by the given margin -measurements. The corners are never stretched/tiled, the left and -right edges will be stretched/tiled vertically, the top and bottom -edges may be stretched/tiled horizontally, and the center may be -stretched/tiled in both directions. -

-

mode may be either stretch (the default) or tile. -

-

margin specifies the margin size for all sides of the 9-patch. -To make margins of differing sizes, the top-margin, -bottom-margin, left-margin, and right-margin -arguments may be used. -

-

Refer to draw-sprite for information about the other arguments -as they are the same. -

- -
-
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Textures.html b/manuals/chickadee/Textures.html deleted file mode 100644 index 5b8e506..0000000 --- a/manuals/chickadee/Textures.html +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - -Textures (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
-
-

5.3.2 Textures

- -

Textures are essentially images: a 2D grid of color values. However, -this is a great simplification. Textures can be used to store any -kind of data that can be encoded into color channels. The -(chickadee graphics texture) module provides an interface for -working with texture objects. -

-
-
Procedure: load-image file [#:min-filter nearest] [#:mag-filter nearest] [#:wrap-s repeat] [#:wrap-t repeat] [#:transparent-color]
-
-

Load the image data from file and return a new texture object. -

-

min-filter and mag-filter describe the method that should -be used for minification and magnification when rendering, -respectively. Possible values are nearest and linear. -

-

wrap-s and wrap-t describe how to interpret texture -coordinates that are greater than 1.0. Possible values are -repeat, mirrored-repeat, clamp, -clamp-to-border, and clamp-to-edge. -

-

For color-keyed images (images where a specific color should be made -transparent), specify the appropriate transparent-color. -

-
- -
-
Procedure: texture? obj
-

Return #t if obj is a texture. -

- -
-
Procedure: texture-region? obj
-

Return #t if obj is a texture region. -

- -
-
Procedure: texture-parent texture
-

If texture is a texture region, return the full texture that it -is based upon. Otherwise, return #f. -

- -
-
Procedure: texture-min-filter texture
-

Return the minification filter for texture, either -nearest or linear. -

- -
-
Procedure: texture-mag-filter texture
-

Return the magnification filter for texture, either -nearest or linear. -

- -
-
Procedure: texture-wrap-s texture
-

Return the method used for wrapping texture coordinates along the X -axis for texture. -

-

Possible wrapping methods: -

    -
  • repeat -
  • clamp -
  • clamp-to-border -
  • clamp-to-edge -
- -
- -
-
Procedure: texture-wrap-t texture
-

Return the method used for wrapping texture coordinates along the Y -axis for texture. -

- -
-
Procedure: texture-width texture
-

Return the width of texture in pixels. -

- -
-
Procedure: texture-height texture
-

Return the height of texture in pixels. -

- -
-
Procedure: current-texture-0
-

Return the current texture associated with texture unit 0 on the GPU. -

- -
-
Procedure: current-texture-1
-

Return the current texture associated with texture unit 1 on the GPU. -

- -
-
Procedure: current-texture-2
-

Return the current texture associated with texture unit 2 on the GPU. -

- -
-
Procedure: current-texture-3
-

Return the current texture associated with texture unit 3 on the GPU. -

- -
-
Procedure: current-texture-4
-

Return the current texture associated with texture unit 4 on the GPU. -

- -
-
Variable: g:texture-0
-

Render state for texture unit 0 (see Rendering Engine.) -

- -
-
Variable: g:texture-1
-

Render state for texture unit 1 (see Rendering Engine.) -

- -
-
Variable: g:texture-2
-

Render state for texture unit 2 (see Rendering Engine.) -

- -
-
Variable: g:texture-3
-

Render state for texture unit 3 (see Rendering Engine.) -

- -
-
Variable: g:texture-4
-

Render state for texture unit 4 (see Rendering Engine.) -

- -

5.3.2.1 Tile Atlases

- -

It is common practice to combine multiple bitmap images into a single -texture, known as a “tile atlas” or “tile set”, because it is more -efficient to render many regions of a large texture than it is to -render a bunch of small textures. Chickadee provides a tile atlas -data type for collecting texture regions into a single vector. -

-
-
Procedure: split-texture texture tile-width tile-height [#:margin 0] [#:spacing 0]
-
-

Return a new texture atlas that splits texture into a grid of -tile-width by tile-height rectangles. Optionally, each -tile may have spacing pixels of horizontal and vertical space -between surrounding tiles and the entire image may have margin -pixels of empty space around its border. -

-

This type of texture atlas layout is very common for 2D tile maps. -See Tile Maps for more information. -

- -
-
Procedure: load-tileset file-name tile-width tile-height [#:margin 0] [#:spacing 0] [#:min-filter nearest] [#:mag-filter nearest] [#:wrap-s repeat] [#:wrap-t repeat] [#:transparent-color]
-
-

Return a new texture atlas that splits the texture loaded from the -file file-name into a grid of tile-width by -tile-height rectangles. See load-image and -split-texture for information about all keyword arguments. -

- -
-
Procedure: texture-atlas? obj
-

Return #t if obj is a texture atlas. -

- -
-
Procedure: texture-atlas-texture atlas
-

Return the texture that all texture regions in atlas have been created from. -

- -
-
Procedure: texture-atlas-ref atlas index
-

Return the texture region in atlas at index. -

- -

5.3.2.2 Cube Maps

- -

A cube map is a special type of texture composed of 6 images that can -be thought of as forming the 6 faces of a cube. See Skyboxes for a -practical use of cube maps. -

-
-
Procedure: load-cube-map #:right #:left #:top #:bottom #:front #:back [#:min-filter linear-mipmap-linear] [#:mag-filter linear]
-
-

Return a new cube map that uses the image data in the files -right, left, top, bottom, front, and -back for the 6 faces of the cube. -

- -
-
Procedure: cube-map? obj
-

Return #t if obj is a cube map. -

- -
-
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/The-Environment.html b/manuals/chickadee/The-Environment.html deleted file mode 100644 index 3e08719..0000000 --- a/manuals/chickadee/The-Environment.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - -The Environment (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Previous: , Up: Audio   [Contents][Index]

-
-
-

5.4.4 The Environment

- -

The environment defines global parameters that govern how sound is -processed within the 3D modeling space. -

-
-
Procedure: doppler-factor
-

Return the current doppler factor. -

- -
-
Procedure: speed-of-sound
-

Return the current speed of sound. -

- -
-
Procedure: distance-model
-

Return the current distance model. -

-

Possible return values are: -

-
    -
  • none -
  • inverse-distance -
  • inverse-distance-clamped (the default) -
  • linear-distance -
  • linear-distance-clamped -
  • exponent-distance -
  • exponent-distance-clamped -
- -
- -
-
Procedure: set-doppler-factor! doppler-factor
-

Change the doppler factor to doppler-factor. -

- -
-
Procedure: set-speed-of-sound! speed-of-sound
-

Change the speed of sound to speed-of-sound. -

- -
-
Procedure: set-distance-model! distance-model
-

Change the distance model to distance-model. Valid distance -models are: -

-
    -
  • none -
  • inverse-distance -
  • inverse-distance-clamped -
  • linear-distance -
  • linear-distance-clamped -
  • exponent-distance -
  • exponent-distance-clamped -
- -
- - - - - - diff --git a/manuals/chickadee/The-Game-Loop.html b/manuals/chickadee/The-Game-Loop.html deleted file mode 100644 index 45a4d42..0000000 --- a/manuals/chickadee/The-Game-Loop.html +++ /dev/null @@ -1,420 +0,0 @@ - - - - - - -The Game Loop (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-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 -“kernel”, is responsible for ensuring that the game is updated at -the desired interval, handling input devices, rendering the current -state of the game world, and handling errors if they occur. The -kernel implements what is known as a “fixed timestep” game loop, -meaning that the game simulation will be advanced by a fixed interval -of time and will never vary from frame to frame, unlike some other -styles of game loops. The appropriately named run-game and -abort-game procedures are the entry and exit points to the -Chickadee game loop. -

-

If you are using chickadee play to launch your game, then -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] [#: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. -

-

A new graphical window will be opened with window-width x -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. 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 -but before the game loop has started. Can be used to perform -initialization that requires an open window and OpenGL context such as -loading textures. - -
  • update: Called update-hz times per second with one -argument: The amount of time to advance the game simulation. - -
  • draw: Called each time a frame should be rendered with a single -argument known as the alpha value. See the documentation for -run-game* for an explanation of this value. - -
  • quit: Called with zero arguments when the user tries to close -the game window. The default behavior is to exit the game. - -
  • key-press: Called with four arguments when a key is pressed on -the keyboard: - -
      -
    1. key: The symbolic name of the key that was pressed. For -example: backspace. - -
    2. modifiers: A list of the symbolic names of modifier keys that -were being held down when the key was pressed. Possible values -include ctrl, alt, and shift. - -
    3. repeat?: #t if this is a repeated press of the same key. - -
    - -
  • key-release: Called with three arguments when a key is released -on the keyboard: - -
      -
    1. key: The symbolic name of the key that was released. - -
    2. modifiers: A list of the symbolic names of modifier keys that -were being held down when the key was released. - -
    - -
  • text-input: Called with a single argument, a string of text, -when printable text is typed on the keyboard. - -
  • mouse-press: Called with four arguments when a mouse button is -pressed: -
      -
    1. button: The symbolic name of the button that was pressed, such -as left, middle, or right. - -
    2. clicks: The number of times the button has been clicked in a row. - -
    3. x: The x coordinate of the mouse cursor. - -
    4. y: The y coordinate of the mouse cursor. - -
    - -
  • mouse-release: Called with three arguments when a mouse button -is released: - -
      -
    1. button: The symbolic name of the button that was released. - -
    2. x: The x coordinate of the mouse cursor. - -
    3. y: The y coordinate of the mouse cursor. - -
    - -
  • mouse-move: Called with five arguments when the mouse is moved: - -
      -
    1. x: The x coordinate of the mouse cursor. - -
    2. y: The y coordinate of the mouse cursor. - -
    3. dx: The amount the mouse has moved along the x axis since the -last mouse move event. - -
    4. dy: The amount the mouse has moved along the y axis since the -last mouse move event. - -
    5. buttons: A list of the buttons that were pressed down when the -mouse was moved. - -
    - -
  • mouse-wheel: Called with two arguments when the mouse wheel is -scrolled: - -
      -
    1. x: The scroll amount along the X axis. - -
    2. y: The scroll amount along the Y axis. - -
    - -
  • controller-add: Called with a single argument, an SDL game -controller object, when a game controller is connected. - -
  • controller-remove: Called with a single argument, an SDL game -controller object, when a game controller is disconnected. - -
  • controller-press: Called with two arguments when a button on a -game controller is pressed: - -
      -
    1. controller: The controller that triggered the event. - -
    2. button: The symbolic name of the button that was pressed. -Possible buttons are: - -
        -
      • a -
      • b -
      • x -
      • y -
      • back -
      • guide -
      • start -
      • left-stick -
      • right-stick -
      • left-shoulder -
      • right-shoulder -
      • dpad-up -
      • dpad-down -
      • dpad-left -
      • dpad-right - -
      - -
    - -
  • controller-release: Called with two arguments when a button on a -game controller is released: - -
      -
    1. controller: The controller that triggered the event. - -
    2. button: The symbolic name of the button that was released. - -
    - -
  • controller-move: Called with three arguments when an analog -stick or trigger on a game controller is moved: - -
      -
    1. controller: The controller that triggered the event. - -
    2. axis: The symbolic name of the axis that was moved. Possible -values are: - -
        -
      • left-x -
      • left-y -
      • right-x -
      • right-y -
      • trigger-left -
      • trigger-right -
      - -
    - -
  • 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: - -
      -
    1. exception: The exception object. - -
    2. stack: The call stack at the point of the exception. - -
    - -

    If no error handler is specified, exceptions will simply be re-raised. -

    -
- -
- -

To stop the game loop, simply call abort-game. -

-
-
Procedure: abort-game
-

Stop the currently running Chickadee game loop. -

- -

The above explanation of the game loop was partially a lie. It’s true -that there is a game loop at the center of Chickadee, but -run-game is not it’s true entry point. There exists an even -lower level procedure, run-game*, in the (chickadee -game-loop) module that run-game uses under the hood. -

-

On its own, run-game* does not do very much at all. In order -to actually respond to input events, update game state, or render -output, the developer must provide an engine. run-game is such -an engine, and it’s likely all a developer will need. However, what -if a developer wanted to use all of the useful Chickadee features to -make a terminal roguelike game instead? Chickadee doesn’t come with a -terminal rendering engine, but the developer could write one without -having to write their own core game loop. -

-
-
Procedure: run-game* [#:init] [#:update] [#:render] [#:time] [#:error] [#:update-hz 60]
-
-

Start the game loop. This procedure will not return until -abort-game is called. -

-

The core game loop is generic and requires four additional procedures -to operate: -

-
    -
  • init: Called just before game loop is started. Use it to -perform game initialization. -
  • update: Called update-hz times per second to advance the -game simulation. This procedure is called with a single argument: The -amount of time that has passed since the last update, in milliseconds. -
  • render: Called each iteration of the loop to render the game to -the desired output device. This procedure is called with a single -argument: A value in the range [0, 1] which represents how much time -has past since the last game state update relative to the upcoming -game state update, as a percentage. Because the game state is updated -independent of rendering, it is often the case that rendering is -occuring between two updates. If the game is rendered as it was -during the last update, a strange side-effect will occur that makes -animation appear rough or “choppy”. To counter this, the -alpha value can be used to perfrom a linear interpolation of a -moving object between its current position and its previous position. -This odd trick has the pleasing result of making the animation look -smooth again, but requires keeping track of previous state. -
  • time: Called to get the current time in seconds. This procedure -is called with no arguments. -
  • error: Called when an error from the update or -render procedures reaches the game loop. This procedure is -called with three arguments: The call stack, the error key, and the -error arguments. If no error handler is provided, the default -behavior is to simply re-throw the error. -
- -
- -
-
Procedure: elapsed-time
-

Return the current value of the system timer in seconds. -

- -
-
-

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

-
- - - - - diff --git a/manuals/chickadee/The-Listener.html b/manuals/chickadee/The-Listener.html deleted file mode 100644 index a6f5ab3..0000000 --- a/manuals/chickadee/The-Listener.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - -The Listener (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Audio   [Contents][Index]

-
-
-

5.4.3 The Listener

- -

The listener is a collection of global state that represents the -player within the 3D sound model. For games that do not need 3D sound -modeling, manipulating the listener’s master volume is the only -interesting thing to do here. -

-
-
Procedure: listener-volume
-

Return the current master volume of the listener. -

- -
-
Procedure: listener-position
-

Return the current position of the listener. -

- -
-
Procedure: listener-velocity
-

Return the current velocity of the listener. -

- -
-
Procedure: listener-orientation
-

Return the current orientation of the listener. -

- -
-
Procedure: set-listener-volume! volume
-

Set the listener’s master volume to volume, a value in the range [0, -1]. -

- -
-
Procedure: set-listener-position! position
-

Set the listener’s position to the 3D vector position. -

- -
-
Procedure: set-listener-velocity! velocity
-

Set the listener’s velocity to the 3D vector velocity. -

- -
-
Procedure: set-listener-orientation! at up
-

Set the listener’s orientation to the 3D vectors at and -up. -

- - - - - - diff --git a/manuals/chickadee/Tile-Maps.html b/manuals/chickadee/Tile-Maps.html deleted file mode 100644 index c6d9339..0000000 --- a/manuals/chickadee/Tile-Maps.html +++ /dev/null @@ -1,366 +0,0 @@ - - - - - - -Tile Maps (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
-
-

5.3.7 Tile Maps

- -

A tile map is a scene created by composing lots of small sprites, -called “tiles”, into a larger image. One program for editing such -maps is called Tiled. Chickadee has native -support for loading and rendering Tiled maps in the (chickadee -graphics tile-map) module. -

-
-
Procedure: load-tile-map file-name [#:chunk-size]
-

Load the Tiled formatted map in file-name and return a new tile -map object. -

- -
-
Procedure: tile-map? obj
-

Return #t if obj is a tile map. -

- -
-
Procedure: tile-map-orientation tile-map
-

Return the orientation of tile-map. -

- -
-
Procedure: tile-map-width tile-map
-

Return the width of tile-map in tiles. -

- -
-
Procedure: tile-map-height tile-map
-

Return the height of tile-map in tiles. -

- -
-
Procedure: tile-map-tile-width tile-map
-

Return the width of tiles in tile-map. -

- -
-
Procedure: tile-map-tile-height tile-map
-

Return the height of tiles in tile-map. -

- -
-
Procedure: tile-map-tilesets tile-map
-

Return the tilesets for tile-map. -

- -
-
Procedure: tile-map-layers tile-map
-

Return the layers of tile-map. -

- -
-
Procedure: tile-map-properties tile-map
-

Return the custom properties of tile-map. -

- -
-
Procedure: point->tile tile-map x y
-

Translate the pixel coordinates (x, y) into tile -coordinates. -

- -
-
Procedure: draw-tile-map tile-map [#:layers] [#:camera] [#:origin] [#:position] [#:scale] [#:rotation] [#:blend-mode] [#:tint] [#:time]
-
-

Draw the layers of tile-map as viewed from camera, a 2D -vector offset. By default, all layers are drawn. To draw a subset of -the available layers, pass a list of layer ids using the layers -keyword argument. -

- -
-
Procedure: tileset? obj
-

Return #t if obj is a tileset. -

- -
-
Procedure: tileset-name tileset
-

Return the name of tileset. -

- -
-
Procedure: tileset-first-gid tileset
-

Return the starting GID of tileset. -

- -
-
Procedure: tileset-size tileset
-

Return the number of tiles in tileset. -

- -
-
Procedure: tileset-tile-width tileset
-

Return the width of tiles in tileset. -

- -
-
Procedure: tileset-tile-height tileset
-

Return the height of tiles in tileset. -

- -
-
Procedure: tileset-atlas tileset
-

Return the texture atlas for tileset. -

- -
-
Procedure: tileset-tiles tileset
-

Return the tiles in tileset. -

- -
-
Procedure: tileset-rows tileset
-

Return the number of rows in tileset. -

- -
-
Procedure: tileset-columns tileset
-

Return the number of columns in tileset. -

- -
-
Procedure: tileset-properties tileset
-

Return the custom properties of tileset. -

- -
-
Procedure: tile? obj
-

Return #t if obj is a tile. -

- -
-
Procedure: tile-id tile
-

Return the ID of tile. -

- -
-
Procedure: tile-animation tile
-

Return the animation for tile. -

- -
-
Procedure: tile-properties tile
-

Return the custom properties of tile. -

- -
-
Procedure: animation? obj
-

Return #t if obj is an animation. -

- -
-
Procedure: animation-frames animation
-

Return a vector of frames in animation. -

- -
-
Procedure: animation-duration animation
-

Return the duration of animation. -

- -
-
Procedure: animation-frame? obj
-

Return #t if obj is an animation frame. -

- -
-
Procedure: animation-frame-tile frame
-

Return the tile for frame. -

- -
-
Procedure: animation-frame-duration frame
-

Return the duration of frame. -

- -
-
Procedure: tile-layer? obj
-

Return #t if obj is a tile layer. -

- -
-
Procedure: tile-layer-name layer
-

Return the name of layer. -

- -
-
Procedure: tile-layer-width layer
-

Return the width in tiles of layer. -

- -
-
Procedure: tile-layer-height layer
-

Return the height in tiles of layer. -

- -
-
Procedure: tile-layer-tiles layer
-

Return the tile data for layer. -

- -
-
Procedure: tile-layer-properties layer
-

Return the custom properties of layer. -

- -
-
Procedure: object-layer? obj
-

Return #t if obj is an object layer. -

- -
-
Procedure: object-layer-name layer
-

Return the name of layer. -

- -
-
Procedure: object-layer-objects layer
-

Return the objects for layer. -

- -
-
Procedure: object-layer-properties layer
-

Return the custom properties of layer. -

- -
-
Procedure: map-object? obj
-

Return #t if obj is a map object. -

- -
-
Procedure: map-object-id obj
-

Return the ID of obj. -

- -
-
Procedure: map-object-name obj
-

Return the name of obj. -

- -
-
Procedure: map-object-type obj
-

Return the type of obj. -

- -
-
Procedure: map-object-shape obj
-

Return the shape of obj. -

- -
-
Procedure: map-object-properties obj
-

Return the custom properties of obj. -

- -
-
Procedure: polygon? obj
-

Return #t if obj is a polygon. -

- -
-
Procedure: polygon-points polygon
-

Return the list of points that form polygon. -

- -
-
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Tweening.html b/manuals/chickadee/Tweening.html deleted file mode 100644 index b69b75e..0000000 --- a/manuals/chickadee/Tweening.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - -Tweening (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Scripting   [Contents][Index]

-
-
-

5.5.3 Tweening

- -

Tweening is the process of transitioning something from an initial -state to a final state over a pre-determined period of time. In other -words, tweening is a way to create animation. The tween -procedure can be used within any script like so: -

-
-
(define x 0)
-(script
-  ;; 0 to 100 in 60 ticks of the agenda.
-  (tween 60 0 100 (lambda (y) (set! x y))))
-
- -
-
Procedure: tween duration start end proc [#:step 1] [#:ease smoothstep] #:interpolate lerp]
-

Transition a value from start to end over duration, -sending each succesive value to proc. step controls the -amount of time between each update of the animation. -

-

To control how the animation goes from the initial to final state, an -“easing” procedure may be specified. By default, the -smoothstep easing is used, which is a more pleasing default -than a simplistic linear function. See Easings for a complete list -of available easing procedures. -

-

The interpolate procedure computes the values in between -start and end. By default, linear interpolation (“lerp” -for short) is used. -

- - - - - - diff --git a/manuals/chickadee/Vector-Paths.html b/manuals/chickadee/Vector-Paths.html deleted file mode 100644 index 81d6307..0000000 --- a/manuals/chickadee/Vector-Paths.html +++ /dev/null @@ -1,462 +0,0 @@ - - - - - - -Vector Paths (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
-
-

5.3.5 Vector Paths

- -

The (chickadee graphics path) module can be used to draw lines, -curves, circles, rectangles, and more in a scalable, resolution -independent manner. It is not an SVG compliant renderer, nor -does it intend to be. However, those familiar with SVG and/or the -HTML5 Canvas API should find lots of similarities. -

-

This API is considered to be experimental and may change -substantially in future releases of Chickadee. There are many missing -features. -

-

The first step to rendering vector graphics is to create a -path: A series of commands that can be thought of as moving a -pen around a piece of paper. A path can be either open or closed. A -closed path draws a straight line from the last point in the path to -the first. -

-
-
Procedure: path . commands
-

Return a new path that follows commands. -

-
-
(path (move-to (vec2 50.0 50.0))
-      (line-to (vec2 500.0 50.0))
-      (line-to (vec2 400.0 200.0))
-      (bezier-to (vec2 500.0 250.0) (vec2 380.0 300.0) (vec2 400.0 400.0))
-      (line-to (vec2 300.0 400.0))
-      (close-path))
-
- -
- -

Available drawing commands: -

-
-
Procedure: move-to point
-

Pick up the pen and move it to point. -

- -
-
Procedure: line-to point
-

Draw a line from the current pen position to point. -

- -
-
Procedure: bezier-to control1 control2 point
-

Draw a cubic bezier curve from the current pen position to -point. The shape of the curve is determined by the two control -points: control1 and control2. -

- -
-
Procedure: close-path
-

Draw a straight line back to the first point drawn in the path. -

- -
-
Procedure: arc center rx ry angle-start angle-end
-

Draw an elliptical arc spanning the angle range [angle-start, -angle-end], centered at center with radii rx and -ry (set both to the same value for a circular arc.) -

- -
-
Procedure: arc-to c1 c2 radius
-

Draw a circular arc with radius radius that is tangential to the -line segment formed by the current pen position and c1, as well -as the line segment formed by c1 and c2. The result is a -smooth corner. -

- -

Included are some helpful procedures for generating common types of -paths: -

-
-
Procedure: line start end
-

Return a path that draws a straight line from start to end. -

- -
-
Procedure: polyline . points
-

Return a path that draws a series of lines connecting points. -

- -
-
Procedure: bezier-path p1 c1 c2 p2 . points
-

Return a path that draws a series of bezier points starting at -p1, moving to p2 using control points c1 and -c2, and proceeding to draw additional bezier curves as defined -by points. Each additional curve requires 3 additional -arguments: two control points and and an ending point. -

- -
-
Procedure: rectangle bottom-left width height
-

Return a path that draws a rectangle whose bottom-left corner is at -bottom-left and whose size is defined by width and -height. -

- -
-
Procedure: square bottom-left size
-

Return a path draws a square whose bottom-left corner is at -bottom-left and whose size is defined by size. -

- -
-
Procedure: rounded-rectangle bottom-left width height [#:radius 4.0] [#:radius-bottom-left] [#:radius-bottom-right] [#:radius-top-left] [#:radius-top-right]
-
-

Return a path that draws a rectangle with rounded corners whose -bottom-left corner is at bottom-left and whose size is defined -by width and height. The argument radius is used to -define the corner radius for all corners. To use a different radius -value for a corner, use radius-bottom-left, -radius-bottom-right, radius-top-left, and/or -radius-top-right. -

- -
-
Procedure: regular-polygon center num-sides radius
-

Return a path that draws a regular polygon with num-sides sides -centered on the point center with each vertex radius units -away from the center. -

- -
-
Procedure: ellipse center rx ry
-

Return a path that draws an ellipsed centered on the point -center with radii rx and ry. -

- -
-
Procedure: circle center r
-

Return a path that draws a circle centered on the point center -with radius r. -

- -

With one or more paths created, a painter is needed to give the -path its style and placement in the final picture. Painters can be -combined together to form arbitrarily complex pictures. -

-
-
Procedure: stroke . paths
-

Apply a stroked drawing style to paths. -

- -
-
Procedure: fill . paths
-

Apply a filled drawing style to paths. -

- -
-
Procedure: fill-and-stroke . paths
-

Apply a filled and stroked drawing style to paths. -

- -
-
Syntax: with-style ((style-name value) ...) painter
-

Apply all the given style settings to painter. -

-

Possible style attributes are: -

-
    -
  • blend-mode -
  • fill-color -
  • stroke-color -
  • stroke-width -
  • stroke-feather -
  • stroke-cap -
- -
-
(with-style ((stroke-color green)
-             (stroke-width 4.0))
-  (stroke (circle (vec2 100.0 100.0) 50.0)))
-
- -
- -

Fill colors may be either solid colors (see Colors) or gradients. -For gradient fills, there are two styles: linear or radial. -

-
-
Procedure: linear-gradient [#:origin (vec2 0 0)] [#:start-color white] [#:end-color black] [#:rotation 0] [#:offset 0] [#:length 100]
-
-

Return a new linear gradient that transitions from start-color -on the left to end-color on the right over length pixels. -offset may be used to push the gradient start point to the -right, creating a solid block of start-color on the right hand -side of the painter. The line’s direction may be changed by -specifying a rotation value. The starting point for the -gradient is determined by origin and defaults to the lower left -corner of the painter’s bounding box. -

- -
-
Procedure: radial-gradient [#:origin (vec2 0 0)] [#:start-color white] [#:end-color black] [#:radius 50.0] [#:radius-x] [#:radius-y] [#:rotation 0] [#:offset 0]
-
-

Return a new radial gradient that transitions from start-color -at the point origin to end-color at radius pixels -away. offset specifies the distance from the origin where -start-color begins to transition. The default is to immediately -start transitioning. The default shape of this type of gradient is a -circle, but it can also be made elliptical by specifying different -radius-x and radius-y values. When the gradient shape is -elliptical, rotation can be used to rotate it. -

- -
-
Procedure: gradient? obj
-

Return #t when obj is a gradient object. -

- -

Painters can also be transformed and combined to form new painters. -

-
-
Procedure: transform matrix painter
-

Apply matrix, a 3x3 transformation matrix (see Matrices), to -painter. -

- -
-
Procedure: translate v painter
-

Translate painter by the 2D vector v. -

- -
-
Procedure: rotate angle painter
-

Rotate painter by angle radians. -

- -
-
Procedure: scale x painter
-

Scale painter by the scalar x. -

- -
-
Procedure: horizontal-flip painter
-

Flip painter horizontally. -

- -
-
Procedure: vertical-flip painter
-

Flip painter vertically. -

- -
-
Procedure: pad pad-x pad-y painter
-

Add pad-x and pad-y amount of empty space around -painter. -

- -
-
Procedure: superimpose . painters
-

Stack painters on top of each other. -

- -

The next batch of procedures is taken straight out of the picture -language described in -Structure and Interpretation of Computer Programs section 2.2.4. -

-
-
Procedure: beside . painters
-

Place painters next to each other in a row. -

- -
-
Procedure: below . painters
-

Place painters next to each other in a column. -

- -
-
Procedure: right-split painter n
-

Subdivide painter into 3 sections, recursively, like so: -

-
*----------------*----------------*
-|                |                |
-|                |  right-split   |
-|                |     n - 1      |
-|                |                |
-|    painter     *----------------*
-|                |                |
-|                |  right-split   |
-|                |     n - 1      |
-|                |                |
-*----------------*----------------*
-
-
- -
-
Procedure: up-split painter n
-

Subdivide painter into 3 sections, recursively, like so: -

-
*----------------*----------------*
-|                |                |
-|    up-split    |    up-split    |
-|     n - 1      |     n - 1      |
-|                |                |
-*----------------*----------------*
-|                                 |
-|             painter             |
-|                                 |
-|                                 |
-*----------------*----------------*
-
-
- -
-
Procedure: corner-split painter n
-

Subdivide painter into 4 sections, recursively, like so: -

-
*----------------*----------------*
-|                |                |
-|    up-split    |  corner-split  |
-|     n - 1      |     n - 1      |
-|                |                |
-*----------------*----------------*
-|                |                |
-|    painter     |  right-split   |
-|                |     n - 1      |
-|                |                |
-*----------------*----------------*
-
-
- - -

As in real life, a painter cannot paint anything without a canvas. -Once a painter has been associated with a canvas, it can finally be -rendered to the screen. -

-
-
Procedure: make-canvas painter [#:matrix]
-

Return a new canvas that will painter will draw on. Optionally, -a 3x3 matrix may be specified to apply an arbitrary -transformation to the resulting image. -

- -
-
Procedure: make-empty-canvas [#:matrix]
-

Return a new canvas that no painter is using. Optionally, a 3x3 -matrix may be specified to apply an arbitrary transformation to -the image, should a painter later be associated with this canvas. -

- -
-
Procedure: canvas? obj
-

Return #t is obj is a canvas. -

- -
-
Procedure: set-canvas-painter! canvas painter
-

Associate painter with canvas. -

- -
-
Procedure: set-canvas-matrix! canvas matrix
-

Set the 3x3 transformation matrix of canvas to matrix. -

- -
-
Procedure: draw-canvas canvas
-

Render canvas to the screen. -

- -
-
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Vectors.html b/manuals/chickadee/Vectors.html deleted file mode 100644 index 8761fe9..0000000 --- a/manuals/chickadee/Vectors.html +++ /dev/null @@ -1,351 +0,0 @@ - - - - - - -Vectors (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Math   [Contents][Index]

-
-
-

5.2.2 Vectors

- -

Unlike Scheme’s vector data type, which is a sequence of arbitrary -Scheme objects, Chickadee’s (chickadee math vector) module -provides vectors in the linear algebra sense: Sequences of numbers -specialized for particular coordinate spaces. As of now, Chickadee -provides 2D and 3D vectors, with 4D vector support coming in a future -release. -

-

Here’s a quick example of adding two vectors: -

-
-
(define v (vec2+ (vec2 1 2) (vec2 3 4)))
-
- -

A Note About Performance -

-

A lot of time has been spent making Chickadee’s vector operations -perform relatively efficiently in critical code paths where excessive -garbage generation will cause major performance issues. The general -rule is that procedures ending with ! perform an in-place -modification of one of the arguments in order to avoid allocating a -new vector. These procedures are also inlined by Guile’s compiler in -order to take advantage of optimizations relating to floating point -math operations. The downside is that since these are not pure -functions, they do not compose well and create more verbose code. -

-

5.2.2.1 2D Vectors

- -
-
Procedure: vec2 x y
-

Return a new 2D vector with coordinates (x, y). -

- -
-
Procedure: vec2/polar r theta
-

Return a new 2D vector containing the Cartesian representation of the -polar coordinate (r, theta). The angle theta is -measured in radians. -

- -
-
Procedure: vec2? obj
-

Return #t if obj is a 2D vector. -

- -
-
Procedure: vec2-x v
-

Return the X coordinate of the 2D vector v. -

- -
-
Procedure: vec2-y v
-

Return the Y coordinate of the 2D vector v. -

- -
-
Procedure: vec2-copy v
-

Return a fresh copy of the 2D vector v. -

- -
-
Procedure: vec2-magnitude v
-

Return the magnitude of the 2D vector v. -

- -
-
Procedure: vec2-dot v1 v2
-

Return the dot product of the 2D vectors v1 and v2. -

- -
-
Procedure: vec2-normalize v
-

Return the normalized form of the 2D vector v. -

- -
-
Procedure: vec2+ v x
-

Add x, either a 2D vector or a scalar (i.e. a real number), to -the 2D vector v and return a new vector containing the sum. -

- -
-
Procedure: vec2- v x
-

Subtract x, either a 2D vector or a scalar, from the 2D vector -v and return a new vector containing the difference. -

- -
-
Procedure: vec2* v x
-

Multiply the 2D vector v by x, a 2D vector or a scalar, -and return a new vector containing the product. -

- -
-
Procedure: set-vec2-x! v x
-

Set the X coordinate of the 2D vector v to x. -

- -
-
Procedure: set-vec2-y! v y
-

Set the Y coordinate of the 2D vector v to y. -

- -
-
Procedure: set-vec2! v x y
-

Set the X and Y coordinates of the 2D vector v to x and -y, respectively. -

- -
-
Procedure: vec2-copy! source target
-

Copy the 2D vector source into the 2D vector target. -

- -
-
Procedure: vec2-add! v x
-

Perform an in-place modification of the 2D vector v by adding -x, a 2D vector or a scalar. -

- -
-
Procedure: vec2-sub! v x
-

Perform an in-place modification of the 2D vector v by -subtracting x, a 2D vector or a scalar. -

- -
-
Procedure: vec2-mult! v x
-

Perform an in-place modification of the 2D vector v by -multiplying it by x, a 2D vector or a scalar. -

- -

5.2.2.2 3D Vectors

- -
-
Procedure: vec3 x y
-

Return a new 2D vector with coordinates (x, y). -

- -
-
Procedure: vec3? obj
-

Return #t if obj is a 3D vector. -

- -
-
Procedure: vec3-x v
-

Return the X coordinate of the 3D vector v. -

- -
-
Procedure: vec3-y v
-

Return the Y coordinate of the 3D vector v. -

- -
-
Procedure: vec3-z v
-

Return the Z coordinate of the 3D vector v. -

- -
-
Procedure: vec3-copy v
-

Return a fresh copy of the 3D vector v. -

- -
-
Procedure: vec3-magnitude v
-

Return the magnitude of the 3D vector v. -

- -
-
Procedure: vec3-dot v1 v2
-

Return the dot product of the 3D vectors v1 and v2. -

- -
-
Procedure: vec3-cross v1 v2
-

Return a new 3D vector containing the cross product of v1 and -v2. -

- -
-
Procedure: vec3-normalize v
-

Return the normalized form of the 3D vector v. -

- -
-
Procedure: vec3+ v x
-

Add x, either a 3D vector or a scalar (i.e. a real number), to -the 3D vector v and return a new vector containing the sum. -

- -
-
Procedure: vec3- v x
-

Subtract x, either a 3D vector or a scalar, from the 3D vector -v and return a new vector containing the difference. -

- -
-
Procedure: vec3* v x
-

Multiply the 3D vector v by x, a 3D vector or a scalar, -and return a new vector containing the product. -

- -
-
Procedure: set-vec3-x! v x
-

Set the X coordinate of the 3D vector v to x. -

- -
-
Procedure: set-vec3-y! v y
-

Set the Y coordinate of the 3D vector v to y. -

- -
-
Procedure: set-vec3-z! v z
-

Set the Z coordinate of the 3D vector v to z. -

- -
-
Procedure: set-vec3! v x y z
-

Set the X, Y, and Z coordinates of the 3D vector v to x, -y, and z, respectively. -

- -
-
Procedure: vec3-copy! source target
-

Copy the 3D vector source into the 3D vector target. -

- -
-
Procedure: vec3-add! v x
-

Perform an in-place modification of the 3D vector v by adding -x, a 3D vector or a scalar. -

- -
-
Procedure: vec3-sub! v x
-

Perform an in-place modification of the 3D vector v by -subtracting x, a 3D vector or a scalar. -

- -
-
Procedure: vec3-mult! v x
-

Perform an in-place modification of the 3D vector v by -multiplying it by x, a 3D vector or a scalar. -

- -
-
Procedure: vec3-cross! dest v1 v2
-

Compute the cross product of the 3D vectors v1 and v2 and -store the result in dest. -

- -
-
-

-Next: , Previous: , Up: Math   [Contents][Index]

-
- - - - - diff --git a/manuals/chickadee/Viewports.html b/manuals/chickadee/Viewports.html deleted file mode 100644 index c60adc3..0000000 --- a/manuals/chickadee/Viewports.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - -Viewports (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Graphics   [Contents][Index]

-
-
-

5.3.15 Viewports

- -

A viewport represents a subset of the screen (or framebuffer). When -rendering a frame, the resulting image will only appear within that -viewport. These aren’t often needed, and Chickadee’s default viewport -occupies the entire screen, but there are certain situations where -they are useful. For example, a split-screen multiplayer game may -render to two different viewports, each occupying a different half of -the screen. -

-

The (chickadee graphics viewport) module provides the following -API: -

-
-
Procedure: make-viewport x y width height [#:clear-color] [#:clear-flags]
-
-

Create a viewport that covers an area of the window starting from -coordinates (x, y) and spanning width x -height pixels. Fill the viewport with clear-color when -clearing the screen. Clear the buffers denoted by the list of symbols -in clear-flags. -

-

Possible values for clear-flags are color-buffer, -depth-buffer, accum-buffer, and stencil-buffer. -

- -
-
Procedure: viewport? obj
-

Return #t if obj is a viewport. -

- -
-
Procedure: viewport-x viewport
-

Return the left edge of viewport. -

- -
-
Procedure: viewport-y viewport
-

Return the bottom edge of viewport. -

- -
-
Procedure: viewport-width viewport
-

Return the width of viewport. -

- -
-
Procedure: viewport-height viewport
-

Return the height of viewport. -

- -
-
Procedure: viewport-clear-color viewport
-

Return the clear color for viewport. -

- -
-
Procedure: viewport-clear-flags viewport
-

Return the list of clear flags for viewport. -

- -
-
Procedure: current-viewport
-

Return the current viewport. -

- -
-
Variable: g:viewport
-

Render state for viewports (see Rendering Engine.) -

- - - - - - diff --git a/manuals/chickadee/Window-Manipulation.html b/manuals/chickadee/Window-Manipulation.html deleted file mode 100644 index 879c12c..0000000 --- a/manuals/chickadee/Window-Manipulation.html +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - -Window Manipulation (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - - - -
-

-Previous: , Up: Kernel   [Contents][Index]

-
-
-

5.1.3 Window Manipulation

- -
-
Procedure: current-window
-

Return the currently active game window. -

- -
-
Procedure: window? obj
-

Return #t if obj is a window object. -

- -
-
Procedure: window-title window
-

Return the title of window. -

- -
-
Procedure: window-width window
-

Return the width of window in pixels. -

- -
-
Procedure: window-height window
-

Return the height of window in pixels. -

- -
-
Procedure: window-x window
-

Retun the X coordinate of the upper-left corner of window. -

- -
-
Procedure: window-y window
-

Return the Y coordinate of the upper-left corner of window. -

- -
-
Procedure: hide-window! window
-

Hide window. -

- -
-
Procedure: show-window! window
-

Show window. -

- -
-
Procedure: maximize-window! window
-

Maximize window. -

- -
-
Procedure: minimize-window! window
-

Minimize window. -

- -
-
Procedure: raise-window! window
-

Make window visible over all other windows. -

- -
-
Procedure: restore-window! window
-

Restore the size and position of a minimized or maximized -window. -

- -
-
Procedure: set-window-border! window border?
-

Enable/disable the border around window. If border? is -#f, the border is disabled, otherwise it is enabled. -

- -
-
Procedure: set-window-title! window title
-

Change the title of window to title. -

- -
-
Procedure: set-window-size! window width height
-

Change the dimensions of window to width x height -pixels. -

- -
-
Procedure: set-window-position! window x y
-

Move the upper-left corner of window to pixel coordinates -(x, y). -

- -
-
Procedure: set-window-fullscreen! window fullscreen?
-

Enable or disable fullscreen mode for window. If -fullscreen? is #f, fullscreen mode is disabled, otherwise -it is enabled. -

- - - - - - diff --git a/manuals/chickadee/index.html b/manuals/chickadee/index.html deleted file mode 100644 index 0d414d5..0000000 --- a/manuals/chickadee/index.html +++ /dev/null @@ -1,267 +0,0 @@ - - - - - - -Top (The Chickadee Game Toolkit) - - - - - - - - - - - - - - - - - -

The Chickadee Game Toolkit

- - - -

Table of Contents

- -
- - -
- - -
-

-Next:   [Contents][Index]

-
-
-

Chickadee

- -

Copyright © 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 -or any later version published by the Free Software Foundation; -with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. -A copy of the license is included in the section entitled “GNU -Free Documentation License”. -

-

A copy of the license is also available from the Free Software -Foundation Web site at http://www.gnu.org/licenses/fdl.html. -

-
- - -

The document was typeset with -GNU Texinfo. -

- - - - - - - - - - - - -
-
-

-Next:   [Contents][Index]

-
- - - - - -- cgit v1.2.3