summaryrefslogtreecommitdiff
path: root/manuals/chickadee/Viewports.html
diff options
context:
space:
mode:
Diffstat (limited to 'manuals/chickadee/Viewports.html')
-rw-r--r--manuals/chickadee/Viewports.html70
1 files changed, 66 insertions, 4 deletions
diff --git a/manuals/chickadee/Viewports.html b/manuals/chickadee/Viewports.html
index 2e46d12..15b3940 100644
--- a/manuals/chickadee/Viewports.html
+++ b/manuals/chickadee/Viewports.html
@@ -1,6 +1,6 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
-<!-- Copyright (C) 2017 David Thompson davet@gnu.org
+<!-- Copyright (C) 2017, 2018, 2019 David Thompson davet@gnu.org
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
@@ -13,6 +13,8 @@ A copy of the license is also available from the Free Software
Foundation Web site at http://www.gnu.org/licenses/fdl.html.
+* Chickadee: (chickadee). Game programming toolkit for Guile.
+
The document was typeset with
http://www.texinfo.org/ (GNU Texinfo).
-->
@@ -30,7 +32,7 @@ http://www.texinfo.org/ (GNU Texinfo).
<link href="Index.html#Index" rel="index" title="Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Graphics.html#Graphics" rel="up" title="Graphics">
-<link href="Scripting.html#Scripting" rel="next" title="Scripting">
+<link href="Rendering-Engine.html#Rendering-Engine" rel="next" title="Rendering Engine">
<link href="Framebuffers.html#Framebuffers" rel="prev" title="Framebuffers">
<style type="text/css">
<!--
@@ -90,11 +92,71 @@ ul.no-bullet {list-style: none}
<a name="Viewports"></a>
<div class="header">
<p>
-Previous: <a href="Framebuffers.html#Framebuffers" accesskey="p" rel="prev">Framebuffers</a>, Up: <a href="Graphics.html#Graphics" accesskey="u" rel="up">Graphics</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
+Next: <a href="Rendering-Engine.html#Rendering-Engine" accesskey="n" rel="next">Rendering Engine</a>, Previous: <a href="Framebuffers.html#Framebuffers" accesskey="p" rel="prev">Framebuffers</a>, Up: <a href="Graphics.html#Graphics" accesskey="u" rel="up">Graphics</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Viewports-1"></a>
-<h4 class="subsection">2.3.11 Viewports</h4>
+<h4 class="subsection">2.3.9 Viewports</h4>
+
+<p>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&rsquo;t often needed, and Chickadee&rsquo;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. For information about how to set the current viewport,
+see <code>with-viewport</code> in <a href="Rendering-Engine.html#Rendering-Engine">Rendering Engine</a>.
+</p>
+<p>The <code>(chickadee render viewport)</code> module provides the following
+API:
+</p>
+<dl>
+<dt><a name="index-make_002dviewport"></a>Procedure: <strong>make-viewport</strong> <em>x y width height [#:clear-color] [#:clear-flags]</em></dt>
+<dd>
+<p>Create a viewport that covers an area of the window starting from
+coordinates (<var>x</var>, <var>y</var>) and spanning <var>width</var> <code>x</code>
+<var>height</var> pixels. Fill the viewport with <var>clear-color</var> when
+clearing the screen. Clear the buffers denoted by the list of symbols
+in <var>clear-flags</var>.
+</p>
+<p>Possible values for <var>clear-flags</var> are <var>color-buffer</var>,
+<var>depth-buffer</var>, <var>accum-buffer</var>, and <var>stencil-buffer</var>.
+</p></dd></dl>
+
+<dl>
+<dt><a name="index-viewport_003f"></a>Procedure: <strong>viewport?</strong> <em>obj</em></dt>
+<dd><p>Return <code>#t</code> if <var>obj</var> is a viewport.
+</p></dd></dl>
+
+<dl>
+<dt><a name="index-viewport_002dx"></a>Procedure: <strong>viewport-x</strong> <em>viewport</em></dt>
+<dd><p>Return the left edge of <var>viewport</var>.
+</p></dd></dl>
+
+<dl>
+<dt><a name="index-viewport_002dy"></a>Procedure: <strong>viewport-y</strong> <em>viewport</em></dt>
+<dd><p>Return the bottom edge of <var>viewport</var>.
+</p></dd></dl>
+
+<dl>
+<dt><a name="index-viewport_002dwidth"></a>Procedure: <strong>viewport-width</strong> <em>viewport</em></dt>
+<dd><p>Return the width of <var>viewport</var>.
+</p></dd></dl>
+
+<dl>
+<dt><a name="index-viewport_002dheight"></a>Procedure: <strong>viewport-height</strong> <em>viewport</em></dt>
+<dd><p>Return the height of <var>viewport</var>.
+</p></dd></dl>
+
+<dl>
+<dt><a name="index-viewport_002dclear_002dcolor"></a>Procedure: <strong>viewport-clear-color</strong> <em>viewport</em></dt>
+<dd><p>Return the clear color for <var>viewport</var>.
+</p></dd></dl>
+
+<dl>
+<dt><a name="index-viewport_002dclear_002dflags"></a>Procedure: <strong>viewport-clear-flags</strong> <em>viewport</em></dt>
+<dd><p>Return the list of clear flags for <var>viewport</var>.
+</p></dd></dl>