summaryrefslogtreecommitdiff
path: root/manuals/guile-sdl2/Rendering.html
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2021-04-13 11:30:50 -0400
committerDavid Thompson <dthompson2@worcester.edu>2021-04-13 11:30:50 -0400
commitce9d6e8ad28b2d84d1a292a871c23b66a4654b54 (patch)
treeade44e7bb7b891c9ae0ceba18633ef4b2a911a7c /manuals/guile-sdl2/Rendering.html
parent2a30eb2a2d5472be3df1254d5d4d04310314e628 (diff)
Add new guile-sdl2 and chickadee releases.
Diffstat (limited to 'manuals/guile-sdl2/Rendering.html')
-rw-r--r--manuals/guile-sdl2/Rendering.html205
1 files changed, 168 insertions, 37 deletions
diff --git a/manuals/guile-sdl2/Rendering.html b/manuals/guile-sdl2/Rendering.html
index 236d4e8..bc9cf5b 100644
--- a/manuals/guile-sdl2/Rendering.html
+++ b/manuals/guile-sdl2/Rendering.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) 2016 David Thompson davet@gnu.org
+<!-- Copyright (C) 2016, 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,10 +13,12 @@ A copy of the license is also available from the Free Software
Foundation Web site at http://www.gnu.org/licenses/fdl.html.
+* Guile-SDL2: (guile-sdl2). SDL2 bindings for Guile.
+
The document was typeset with
http://www.texinfo.org/ (GNU Texinfo).
-->
-<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
+<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Rendering (Guile-SDL2)</title>
@@ -26,33 +28,24 @@ http://www.texinfo.org/ (GNU Texinfo).
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
-<link href="index.html#Top" rel="start" title="Top">
-<link href="Index.html#Index" rel="index" title="Index">
+<link href="index.html" rel="start" title="Top">
+<link href="Index.html" rel="index" title="Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
-<link href="API-Reference.html#API-Reference" rel="up" title="API Reference">
-<link href="Images.html#Images" rel="next" title="Images">
-<link href="Surfaces.html#Surfaces" rel="prev" title="Surfaces">
+<link href="API-Reference.html" rel="up" title="API Reference">
+<link href="Blend-Modes.html" rel="next" title="Blend Modes">
+<link href="Surfaces.html" rel="prev" title="Surfaces">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
-blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
-blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
-div.smalldisplay {margin-left: 3.2em}
-div.smallexample {margin-left: 3.2em}
-div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
-pre.smalldisplay {font-family: inherit; font-size: smaller}
-pre.smallexample {font-size: smaller}
-pre.smallformat {font-family: inherit; font-size: smaller}
-pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
@@ -87,21 +80,19 @@ ul.no-bullet {list-style: none}
</head>
<body lang="en">
-<a name="Rendering"></a>
-<div class="header">
+<span id="Rendering"></span><div class="header">
<p>
-Next: <a href="Images.html#Images" accesskey="n" rel="next">Images</a>, Previous: <a href="Surfaces.html#Surfaces" accesskey="p" rel="prev">Surfaces</a>, Up: <a href="API-Reference.html#API-Reference" accesskey="u" rel="up">API Reference</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="Blend-Modes.html" accesskey="n" rel="next">Blend Modes</a>, Previous: <a href="Surfaces.html" accesskey="p" rel="prev">Surfaces</a>, Up: <a href="API-Reference.html" accesskey="u" rel="up">API Reference</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
-<a name="Rendering-1"></a>
-<h3 class="section">3.7 Rendering</h3>
+<span id="Rendering-1"></span><h3 class="section">3.7 Rendering</h3>
<div class="example">
<pre class="example">(use-modules (sdl2 render))
</pre></div>
<dl>
-<dt><a name="index-make_002drenderer"></a>Procedure: <strong>make-renderer</strong> <em>window [#:optional flags='(accelerated vsync)]</em></dt>
+<dt id="index-make_002drenderer">Procedure: <strong>make-renderer</strong> <em>window [#:optional flags='(accelerated vsync)]</em></dt>
<dd><p>Return a new renderer for <var>window</var> created with the options specified
in <var>flags</var>, a list of symbols. The valid symbols that may appear in
<var>flags</var> are:
@@ -115,74 +106,214 @@ in <var>flags</var>, a list of symbols. The valid symbols that may appear in
</dd></dl>
<dl>
-<dt><a name="index-renderer_003f"></a>Procedure: <strong>renderer?</strong> <em>r</em></dt>
+<dt id="index-renderer_003f">Procedure: <strong>renderer?</strong> <em>r</em></dt>
<dd><p>Return <code>#t</code> if <var>r</var> is a renderer.
</p></dd></dl>
<dl>
-<dt><a name="index-delete_002drenderer_0021"></a>Procedure: <strong>delete-renderer!</strong> <em>renderer</em></dt>
+<dt id="index-delete_002drenderer_0021">Procedure: <strong>delete-renderer!</strong> <em>renderer</em></dt>
<dd><p>Delete the rendering context <var>renderer</var>.
</p></dd></dl>
<dl>
-<dt><a name="index-call_002dwith_002drenderer"></a>Procedure: <strong>call-with-renderer</strong> <em>renderer proc</em></dt>
+<dt id="index-call_002dwith_002drenderer">Procedure: <strong>call-with-renderer</strong> <em>renderer proc</em></dt>
<dd><p>Call <var>proc</var>, passing it <var>renderer</var> and closing <var>renderer</var> upon exit
of <var>proc</var>.
</p></dd></dl>
<dl>
-<dt><a name="index-clear_002drenderer"></a>Procedure: <strong>clear-renderer</strong> <em>renderer</em></dt>
+<dt id="index-clear_002drenderer">Procedure: <strong>clear-renderer</strong> <em>renderer</em></dt>
<dd><p>Clear the rendering target <var>renderer</var> with the current drawing color.
</p></dd></dl>
<dl>
-<dt><a name="index-present_002drenderer"></a>Procedure: <strong>present-renderer</strong> <em>renderer</em></dt>
+<dt id="index-present_002drenderer">Procedure: <strong>present-renderer</strong> <em>renderer</em></dt>
<dd><p>Display <var>renderer</var>.
</p></dd></dl>
<dl>
-<dt><a name="index-render_002dcopy"></a>Procedure: <strong>render-copy</strong> <em>renderer texture [#:angle 0] [#:srcrect] [#:dstrect] [#:center]</em></dt>
+<dt id="index-renderer_002dinteger_002dscale">Procedure: <strong>renderer-integer-scale</strong> <em>renderer</em></dt>
+<dd><p>Returns <code>#t</code> if <var>renderer</var> currently uses integer scaling and
+<code>#f</code> otherwise. Integer scaling can be used together with
+logical size to effectively restrict the drawing region to an area
+even if the window is larger than that.
+</p></dd></dl>
+
+<dl>
+<dt id="index-set_002drenderer_002dinteger_002dscale_0021">Procedure: <strong>set-renderer-integer-scale!</strong> <em>renderer enable?</em></dt>
+<dd><p>If <var>enable?</var> is <code>#t</code>, enable integer scaling, otherwise
+disable it.
+</p></dd></dl>
+
+<dl>
+<dt id="index-renderer_002dlogical_002dsize">Procedure: <strong>renderer-logical-size</strong> <em>renderer</em></dt>
+<dd><p>Return the current logical size used by <var>renderer</var>.
+</p></dd></dl>
+
+<dl>
+<dt id="index-set_002drenderer_002dlogical_002dsize_0021">Procedure: <strong>set-renderer-logical-size!</strong> <em>renderer width height</em></dt>
+<dd><p>Set the logical size of <var>renderer</var> to <var>width</var> x <var>height</var>.
+</p></dd></dl>
+
+<dl>
+<dt id="index-renderer_002dscale">Procedure: <strong>renderer-scale</strong> <em>renderer</em></dt>
+<dd><p>Return the scaling factors <code>(X Y)</code> used by <var>renderer</var> to
+scale coordinates.
+</p></dd></dl>
+
+<dl>
+<dt id="index-set_002drenderer_002dscale_0021">Procedure: <strong>set-renderer-scale!</strong> <em>renderer scale-x scale-y</em></dt>
+<dd><p>Set the factors by which <var>renderer</var> scales coordinates according
+to the scaling factors <var>scale-x</var> and <var>scale-y</var>.
+</p></dd></dl>
+
+<dl>
+<dt id="index-renderer_002dviewport">Procedure: <strong>renderer-viewport</strong> <em>renderer</em></dt>
+<dd><p>Return the rectangle that <var>renderer</var> currently draws on. If the
+entire region is used, all values of that rectangle will be 0.
+</p></dd></dl>
+
+<dl>
+<dt id="index-set_002drenderer_002dviewport_0021">Procedure: <strong>set-renderer-viewport!</strong> <em>renderer rect</em></dt>
+<dd><p>Set the drawing area for <var>renderer</var> to <var>rect</var>.
+</p></dd></dl>
+
+<dl>
+<dt id="index-render_002dcopy">Procedure: <strong>render-copy</strong> <em>renderer texture [#:angle 0] [#:srcrect] [#:dstrect] [#:center]</em></dt>
<dd><p>Copy <var>texture</var> to the rendering target of <var>renderer</var>.
</p></dd></dl>
<dl>
-<dt><a name="index-render_002ddraw_002dline"></a>Procedure: <strong>render-draw-line</strong> <em>renderer x1 y1 x2 y2</em></dt>
+<dt id="index-set_002drenderer_002ddraw_002dcolor_0021">Procedure: <strong>set-renderer-draw-color!</strong> <em>renderer r g b a</em></dt>
+<dd><p>Set color of <var>renderer</var> to the 32-bit color defined by the 8-bit
+color channels <var>r</var>, <var>g</var>, <var>b</var>, <var>a</var>. Each color channel
+value is in the range [0, 255].
+</p></dd></dl>
+
+<dl>
+<dt id="index-set_002drenderer_002ddraw_002dblend_002dmode_0021">Procedure: <strong>set-renderer-draw-blend-mode!</strong> <em>renderer blend-mode</em></dt>
+<dd><p>Set blend mode of <var>renderer</var> to <var>blend-mode</var>. See <a href="Blend-Modes.html">Blend Modes</a> for more information.
+</p></dd></dl>
+
+<dl>
+<dt id="index-set_002drenderer_002dtarget_0021">Procedure: <strong>set-renderer-target!</strong> <em>renderer texture</em></dt>
+<dd><p>Sets the render target for <var>renderer</var> to <var>texture</var>, making all
+comming draw requests redirect to <var>texture</var>.
+</p>
+<p>Pass <code>#f</code> to reset it to the default target.
+</p></dd></dl>
+
+<dl>
+<dt id="index-renderer_002dtarget">Procedure: <strong>renderer-target</strong> <em>renderer</em></dt>
+<dd><p>Returns the current render target of <var>renderer</var> or <code>#f</code> if
+it&rsquo;s a texture.
+</p></dd></dl>
+
+<dl>
+<dt id="index-draw_002dline">Procedure: <strong>draw-line</strong> <em>renderer x1 y1 x2 y2</em></dt>
<dd><p>Draw a line from (<var>x1</var>, <var>y1</var>) to (<var>x2</var>, <var>y2</var>) on the
current rendering target of <var>renderer</var>.
</p></dd></dl>
<dl>
-<dt><a name="index-render_002ddraw_002dlines"></a>Procedure: <strong>render-draw-lines</strong> <em>renderer point</em></dt>
+<dt id="index-draw_002dlines">Procedure: <strong>draw-lines</strong> <em>renderer points</em></dt>
<dd><p>Draw a series of connected lines from <var>points</var> on the current
-rendering target of <var>renderer</var>.
+rendering target of <var>renderer</var>. Optionally, for best performance,
+<var>points</var> may instead be a bytevector packed with signed 32 bit
+integers, 2 per point (x and y).
</p></dd></dl>
<dl>
-<dt><a name="index-render_002ddraw_002dpoint"></a>Procedure: <strong>render-draw-point</strong> <em>renderer x y</em></dt>
+<dt id="index-draw_002dpoint">Procedure: <strong>draw-point</strong> <em>renderer x y</em></dt>
<dd><p>Draw a point at (<var>x</var>, <var>y</var>) on the current rendering target
of <var>renderer</var>.
</p></dd></dl>
<dl>
-<dt><a name="index-render_002ddraw_002dpoints"></a>Procedure: <strong>render-draw-points</strong> <em>renderer points</em></dt>
+<dt id="index-draw_002dpoints">Procedure: <strong>draw-points</strong> <em>renderer points</em></dt>
<dd><p>Draw a multiple points from <var>points</var> on the current rendering
-target of <var>renderer</var>.
+target of <var>renderer</var>. Optionally, for best performance,
+<var>points</var> may instead be a bytevector packed with signed 32 bit
+integers, 2 per point (x and y).
+</p></dd></dl>
+
+<dl>
+<dt id="index-draw_002drect">Procedure: <strong>draw-rect</strong> <em>renderer rectangle</em></dt>
+<dd><p>Draw the outline of <var>rectangle</var> onto renderer.
+</p></dd></dl>
+
+<dl>
+<dt id="index-draw_002drects">Procedure: <strong>draw-rects</strong> <em>renderer rects</em></dt>
+<dd><p>Draw the outline of all rects in the list <var>rects</var> onto
+<var>renderer</var>. Optionally, for best performance, <var>rects</var> may
+instead be a bytevector packed with signed 32 bit integers, 4 per rect
+(x, y, width, height).
+</p></dd></dl>
+
+<dl>
+<dt id="index-fill_002drect-1">Procedure: <strong>fill-rect</strong> <em>renderer rectangle</em></dt>
+<dd><p>Fill <var>rectangle</var> onto <var>renderer</var>.
+</p></dd></dl>
+
+<dl>
+<dt id="index-fill_002drects">Procedure: <strong>fill-rects</strong> <em>renderer rects</em></dt>
+<dd><p>Fill the list <var>rects</var> onto <var>renderer</var>. Optionally, for best
+performance, <var>rects</var> may instead be a bytevector packed with
+signed 32 bit integers, 4 per rect (x, y, width, height).
+</p></dd></dl>
+
+<dl>
+<dt id="index-make_002dtexture">Procedure: <strong>make-texture</strong> <em>renderer format access width height</em></dt>
+<dd><p>Returns a new texture for <var>renderer</var> with pixel <var>format</var>.
+<var>access</var> is one of the symbols:
+</p>
+<ul>
+<li> static, changes rarely, not lockable
+</li><li> streaming, changes frequently, lockable
+</li><li> target, can be used as a render target
+requires that renderer was created with the <code>texture</code> flag.
+</li></ul>
+</dd></dl>
+
+<dl>
+<dt id="index-query_002dtexture">Procedure: <strong>query-texture</strong> <em>texture</em></dt>
+<dd><p>Return 4 values for the format, access, width and height of a texture.
</p></dd></dl>
<dl>
-<dt><a name="index-surface_002d_003etexture"></a>Procedure: <strong>surface-&gt;texture</strong> <em>renderer surface</em></dt>
+<dt id="index-surface_002d_003etexture">Procedure: <strong>surface-&gt;texture</strong> <em>renderer surface</em></dt>
<dd><p>Convert <var>surface</var> to a texture suitable for <var>renderer</var>.
</p></dd></dl>
<dl>
-<dt><a name="index-delete_002dtexture_0021"></a>Procedure: <strong>delete-texture!</strong> <em>texture</em></dt>
+<dt id="index-delete_002dtexture_0021">Procedure: <strong>delete-texture!</strong> <em>texture</em></dt>
<dd><p>Free the memory used by <var>texture</var>.
</p></dd></dl>
+<dl>
+<dt id="index-texture_002dcolor_002dmod">Procedure: <strong>texture-color-mod</strong> <em>texture</em></dt>
+<dd><p>Get color mod of <var>texture</var> as a list of the integers.
+</p></dd></dl>
+
+<dl>
+<dt id="index-texture_002dalpha_002dmod">Procedure: <strong>texture-alpha-mod</strong> <em>texture</em></dt>
+<dd><p>Get alpha mod of <var>texture</var> as a single integer.
+</p></dd></dl>
+
+<dl>
+<dt id="index-set_002dtexture_002dcolor_002dmod_0021">Procedure: <strong>set-texture-color-mod!</strong> <em>texture r g b</em></dt>
+<dd><p>Set the color mod of <var>texture</var>.
+</p></dd></dl>
+
+<dl>
+<dt id="index-set_002dtexture_002dalpha_002dmod_0021">Procedure: <strong>set-texture-alpha-mod!</strong> <em>texture a</em></dt>
+<dd><p>Set the alpha mod of <var>texture</var>.
+</p></dd></dl>
+
<hr>
<div class="header">
<p>
-Next: <a href="Images.html#Images" accesskey="n" rel="next">Images</a>, Previous: <a href="Surfaces.html#Surfaces" accesskey="p" rel="prev">Surfaces</a>, Up: <a href="API-Reference.html#API-Reference" accesskey="u" rel="up">API Reference</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="Blend-Modes.html" accesskey="n" rel="next">Blend Modes</a>, Previous: <a href="Surfaces.html" accesskey="p" rel="prev">Surfaces</a>, Up: <a href="API-Reference.html" accesskey="u" rel="up">API Reference</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html" title="Index" rel="index">Index</a>]</p>
</div>