update for SDL::Event
[sdlgit/SDL-Site.git] / pages / SDL-Tutorial-Animation.html-inc
index de815d6..df5b3fb 100644 (file)
@@ -59,11 +59,33 @@ frame and saving and restoring the background for every object drawn.</p>
 <div id="Redrawing_the_Screen_CONTENT">
 <p>Since you have to draw the screen in the right order once to start with it's
 pretty easy to make this into a loop and redraw things in the right order for
-every frame.  Given a <a href="SDL-App.html">SDL::App</a> object <code>$app</code>, a <a href="SDL-Rect.html">SDL::Rect</a> <code>$rect</code>, and
+every frame.  Given a <a href="http://search.cpan.org/perldoc?SDLx::App">SDLx::App</a> object <code>$app</code>, a <a href="SDL-Rect.html">SDL::Rect</a> <code>$rect</code>, and
 a <a href="SDL-Color.html">SDL::Color</a> <code>$color</code>, you only have to create a new SDL::Rect <code>$bg</code>,
-representing the whole of the background surface and a new SDL::Color
-<code>$bg_color</code>, representing the background color.  You can write a
-<code>draw_frame()</code> function as follows:</p>
+representing the whole of the background surface and a new mapped color 
+<code>$bg_color</code>, representing the background color.  The colors need to be mapped 
+to the format of the current display. This is done by <a href="SDL-Video::map_RGB.html">SDL::Video::map_RGB</a>.</p>
+<p>&nbsp;</p>
+<p>my $color = SDL::Video::map_RGB (
+        $app-&gt;format,
+        $rect_r,
+        $rect_g,
+        $rect_b,
+);</p>
+<p>my $bg_color = SDL::Video::map_RGB (
+        $app-&gt;format,
+        $bg_r,
+        $bg_g,
+        $bg_b,
+);</p>
+<p>&nbsp;</p>
+
+
+
+
+
+
+
+<p>You can write a <code>draw_frame()</code> function as follows:</p>
 <p>&nbsp;</p>
 <pre>  sub draw_frame
        {
@@ -170,8 +192,8 @@ them soon.</p>
 <h1 id="AUTHOR">AUTHOR</h1><p><a href="#TOP" class="toplink">Top</a></p>
 <div id="AUTHOR_CONTENT">
 <p>chromatic, &lt;chromatic@wgz.org&gt;</p>
-<p>updated by kthakore, &lt;kthakore@cpan.org&gt;</p>
-<p>Written for and maintained by the Perl SDL project, <a href="http://sdl.perl.org/">http://sdl.perl.org/</a>.</p>
+<p>Written for and maintained by the Perl SDL project, <a href="http://sdl.perl.org/">http://sdl.perl.org/</a>.
+See <b>AUTHORS</b> in <cite>SDL</cite>.</p>
 
 </div>
 <h1 id="BUGS">BUGS</h1><p><a href="#TOP" class="toplink">Top</a></p>