Permalink
Browse files

added images

  • Loading branch information...
1 parent d1e6a64 commit 027356c6a331acb0e17536008457e944d3ba3299 @kthakore kthakore committed Sep 1, 2010
View
2 code_listings/drawing.pl
@@ -3,7 +3,7 @@
use SDL;
use SDLx::App;
-my $app = SDLx::App->new(width => 400, height => 400, title => 'Pong - A clone');
+my $app = SDLx::App->new(width => 400, height => 400, title => 'Drawing Examples');
$app->draw_line( [200,20], [20,200], [255, 255, 0, 255] );
View
22 src/02-drawing.pod
@@ -15,7 +15,7 @@ make a pretty picture.
use SDL;
use SDLx::App;
- my $app = SDLx::App->new( w => 400, h => 400 );
+ my $app = SDLx::App->new( w => 400, h => 400, title => 'Drawing Examples' );
#Draw Code Starts Here
@@ -70,6 +70,11 @@ Drawing X<Primitives> are usually simples shapes that can be used for creating g
This will draw a yellow line from positions C< (200,20) > to C< (20,200) >.
+=for figure
+ \includegraphics[width=0.5\textwidth]{../src/images/draw-1.png}
+ \caption{Drawing a line}
+ \label{fig:draw_line}
+
=head2 Rectangles
Rectangles are a common building blocks for games. In SDL rectangles are the most cost effective of the primitives to draw.
@@ -78,6 +83,11 @@ Rectangles are a common building blocks for games. In SDL rectangles are the mos
The above will add a white square of size C<40x40> onto the screen at the position C<(10,20)>.
+=for figure
+ \includegraphics[width=0.5\textwidth]{../src/images/draw-2.png}
+ \caption{Drawing a Rectangle}
+ \label{fig:draw_rect}
+
=head2 Circles
Circles are drawn similarly either filled or unfilled.
@@ -87,6 +97,16 @@ Circles are drawn similarly either filled or unfilled.
Now we will have a filled circle, colored blue and unfilled circle, colored as red.
+=for figure
+ \includegraphics[width=0.5\textwidth]{../src/images/draw-3.png}
+ \caption{Drawing a Circle}
+ \label{fig:draw_circle}
+
+=for figure
+ \includegraphics[width=0.5\textwidth]{../src/images/draw-4.png}
+ \caption{Drawing a filled Circle}
+ \label{fig:draw_filled_circle}
+
=head2 More GFX functions
For more complex drawing functions have a look at C<SDL::GFX::Primitives>.
View
BIN src/images/draw-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN src/images/draw-2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN src/images/draw-3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN src/images/draw-4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 027356c

Please sign in to comment.