Skip to content

Commit

Permalink
Indexing for Drawing
Browse files Browse the repository at this point in the history
  • Loading branch information
kthakore committed Jul 26, 2011
1 parent f9166ca commit 48fdb0e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
20 changes: 18 additions & 2 deletions dist/SDL_Manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,11 @@ <h4>Rectangular Parameters</h4>

<pre><code> my $rect = [20, 20, 40, 40];</code></pre>

<p><a name="Draw"> </p>
<p></p>

<h4>Color</h4>

<p><a name="Draw"> </p>
<p></p>

<p>Need to document what the magnitude of the color and transparency values
mean.</p>
Expand Down Expand Up @@ -418,6 +418,8 @@ <h4>Color</h4>

<h5>NOTE: Depth of Surface</h5>

<p></p>

<p>The color depth of the surface--how many bits are available to describe
colors--is a property of the relevant <code>SDLx::Surface</code> or
<code>SDLx::App</code>. Set it in its constructor:</p>
Expand All @@ -431,6 +433,8 @@ <h5>NOTE: Depth of Surface</h5>

<h3>Pixels</h3>

<p></p>

<p>All <code>SDLx::Surface</code>s are collections of pixels. You can read
from and write to these pixels by treating the surface as an array
reference:</p>
Expand All @@ -454,6 +458,8 @@ <h3>Primitives</h3>

<h4>Lines</h4>

<p></p>

<p>A line is a series of contiguous pixels between two points. The
<code>draw_line</code> method causes SDL to draw a line to a surface:</p>

Expand Down Expand Up @@ -509,6 +515,8 @@ <h4>Circles</h4>

<h3>Drawing with Primitives</h3>

<p></p>

<p>It's easy to combine several primitives to draw an interesting
images.</p>

Expand Down Expand Up @@ -557,12 +565,16 @@ <h3>Drawing with Primitives</h3>

<h2>Drawing on Multiple Surfaces</h2>

<p></p>

<p>The examples so far have drawn on only a single surface, the display.
SDL makes it possible to write on multiple surfaces. These other surfaces
exist only in memory until you draw them to the display.</p>

<h3>Creating Surfaces</h3>

<p></p>

<p>There are several ways to create an <code>SDLx::Surface</code> for use.
The most common is to create one manually with a constructor call:</p>

Expand All @@ -576,6 +588,8 @@ <h3>Creating Surfaces</h3>

<pre><code> $surface = SDL::Image::load( &#39;picture.png&#39; );</code></pre>

<p></p>

<p>In the event that the desired <code>SDL_image</code> library is
unavailable, you can fallback to the built-in support for the
<code>.bmp</code> format.</p>
Expand All @@ -595,6 +609,8 @@ <h2>Lots of Flowers but One Seed</h2>
useful for moving images. Here's a revised example using
<code>SDLx::Sprite</code> for flowers:</p>

<p></p>

<pre><code> use strict;
use warnings;
use SDL;
Expand Down
Binary file modified dist/SDL_Manual.pdf
Binary file not shown.
2 changes: 0 additions & 2 deletions src/02-drawing.pod
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,10 @@ height:

my $rect = [20, 20, 40, 40];

Z<Draw>
X<Rectangular Parameters>

=head3 Color

Z<Draw>
X<Color Parameters>

=for editor
Expand Down

0 comments on commit 48fdb0e

Please sign in to comment.