Permalink
Browse files

Cleaned up all of SDL::App to SDLx::App

  • Loading branch information...
1 parent 6e1f923 commit c3d720d5bfae352f9bea4a078a50f0978a95e170 @kthakore kthakore committed Jun 22, 2010
Showing with 112 additions and 112 deletions.
  1. +2 −2 examples/adventure/adventure.pl
  2. +2 −2 examples/openglapp.pl
  3. +2 −2 lib/SDL/Tutorial.pm
  4. +3 −3 lib/SDL/Tutorial/Animation.pm
  5. +2 −2 lib/SDL/Tutorial/LunarLander.pm
  6. +5 −5 lib/SDLx/App.pm
  7. 0 lib/{SDL/Game → SDLx}/Rect.pm
  8. +20 −20 lib/pods/SDL/App.pod
  9. +8 −8 lib/pods/SDL/Cookbook/PDL.pod
  10. +1 −1 lib/pods/SDL/GFX/Primitives.pod
  11. +1 −1 lib/pods/SDL/OpenGL.pod
  12. +6 −6 lib/pods/SDL/Tutorial.pod
  13. +1 −1 lib/pods/SDL/Tutorial/Animation.pod
  14. +3 −3 lib/pods/SDL/Tutorial/LunarLander.pod
  15. +2 −2 t/core_surface.t
  16. +4 −4 t/intergation1.t
  17. +1 −1 t/sdlx_app.t
  18. +1 −1 t_backcompat/MoP/lib/SDL/Tutorial/MoP/View/Map.pm
  19. +2 −2 t_backcompat/OpenGL/test1.pl
  20. +2 −2 t_backcompat/OpenGL/test2.pl
  21. +2 −2 t_backcompat/OpenGL/test3.pl
  22. +2 −2 t_backcompat/OpenGL/test4.pl
  23. +2 −2 t_backcompat/OpenGL/test5.pl
  24. +2 −2 t_backcompat/OpenGL/tutorial/lesson02.pl
  25. +2 −2 t_backcompat/OpenGL/tutorial/lesson03.pl
  26. +2 −2 t_backcompat/OpenGL/tutorial/lesson04.pl
  27. +2 −2 t_backcompat/OpenGL/tutorial/lesson05.pl
  28. +2 −2 t_backcompat/OpenGL/tutorial/lesson06.pl
  29. +2 −2 t_backcompat/OpenGL/tutorial/lesson07.pl
  30. +2 −2 t_backcompat/OpenGL/tutorial/lesson08.pl
  31. +2 −2 t_backcompat/OpenGL/tutorial/lesson18.pl
  32. +2 −2 t_backcompat/checkkeys.pl
  33. +2 −2 t_backcompat/graywin.pl
  34. +2 −2 t_backcompat/testcolor.pl
  35. +2 −2 t_backcompat/testcolor.spl
  36. +2 −2 t_backcompat/testfonttool.pl
  37. +2 −2 t_backcompat/testgfxprim.pl
  38. +2 −2 t_backcompat/testgfxroto.pl
  39. +2 −2 t_backcompat/testgraphictool.pl
  40. +2 −2 t_backcompat/testjoystick.pl
  41. +2 −2 t_backcompat/testsprite.pl
  42. +2 −2 xt/06_surfaceML.t
@@ -129,7 +129,7 @@ package main;
use warnings;
use SDL;
-use SDL::App;
+use SDLx::App;
use SDL::Surface;
use SDL::Color;
@@ -139,7 +139,7 @@ package main;
my ($bg_r, $bg_g, $bg_b) = ( 0x77, 0xee, 0x77 );
my $sleep_msec = 0.05;
-my $app = SDL::App->new(
+my $app = SDLx::App->new(
-width => $width,
-height => $height,
-depth => $depth,
@@ -4,7 +4,7 @@
use strict;
use warnings;
use SDL;
-use SDL::App;
+use SDLx::App;
use SDL::Mouse;
use SDL::Video;
use SDL::Events;
@@ -16,7 +16,7 @@
$| = 1;
$WIDTH = 1024;
$HEIGHT = 768;
-$SDLAPP = SDL::App->new(-title => "Opengl App", -width => $WIDTH, -height => $HEIGHT, -gl => 1);
+$SDLAPP = SDLx::App->new(-title => "Opengl App", -width => $WIDTH, -height => $HEIGHT, -gl => 1);
$SDLEVENT = SDL::Event->new;
SDL::Mouse::show_cursor(0);
View
@@ -34,13 +34,13 @@ use strict;
use warnings;
use SDL;
-use SDL::App;
+use SDLx::App;
# change these values as necessary
my $title = 'My SDL App';
my ($width, $height, $depth) = ( 640, 480, 16 );
-my $app = SDL::App->new(
+my $app = SDLx::App->new(
-width => $width,
-height => $height,
-depth => $depth,
@@ -34,7 +34,7 @@ use strict;
use warnings;
use SDL;
-use SDL::App;
+use SDLx::App;
use SDL::Rect;
use SDL::Color;
use SDL::Video;
@@ -46,7 +46,7 @@ my ($bg_r, $bg_g, $bg_b) = ( 0x00, 0x00, 0x00 );
my ($rect_r, $rect_g, $rect_b) = ( 0x00, 0x00, 0xff );
my ($rect_width, $rect_height, $rect_y) = ( 100, 100, 190 );
-my $app = SDL::App->new(
+my $app = SDLx::App->new(
-width => $width,
-height => $height,
-depth => $depth,
@@ -166,7 +166,7 @@ frame and saving and restoring the background for every object drawn.
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 L<SDL::App> object C<$app>, a L<SDL::Rect> C<$rect>, and
+every frame. Given a L<SDLx::App> object C<$app>, a L<SDL::Rect> C<$rect>, and
a L<SDL::Color> C<$color>, you only have to create a new SDL::Rect C<$bg>,
representing the whole of the background surface and a new SDL::Color
C<$bg_color>, representing the background color. You can write a
@@ -908,15 +908,15 @@ D8 BC C3 52 B7 FA 3F F9 91 00 CA 7A 4B E9 FF D9
#!/usr/bin/perl
use SDL; #needed to get all constants
use SDL::Video;
-use SDL::App;
+use SDLx::App;
use SDL::Surface;
use SDL::Rect;
use SDL::Image;
use strict;
use warnings;
-my $app = SDL::App->new(
+my $app = SDLx::App->new(
-title => "Lunar Lander",
-width => 800,
-height => 600,
View
@@ -61,7 +61,7 @@ sub new {
$f |= SDL::Video::SDL_ASYNCBLIT if ($async);
if ($f & SDL::Video::SDL_OPENGL) {
- $SDL::App::USING_OPENGL = 1;
+ $SDLx::App::USING_OPENGL = 1;
SDL::Video::GL_set_attribute(SDL::Constants::SDL_GL_RED_SIZE(),$r) if ($r);
SDL::Video::GL_set_attribute(SDL::Constants::SDL_GL_GREEN_SIZE(),$g) if ($g);
SDL::Video::GL_set_attribute(SDL::Constants::SDL_GL_BLUE_SIZE(),$b) if ($b);
@@ -76,7 +76,7 @@ sub new {
SDL::Video::GL_set_attribute(SDL::Constants::SDL_GL_BUFFER_SIZE(),$bs) if ($bs);
SDL::Video::GL_set_attribute(SDL::Constants::SDL_GL_DEPTH_SIZE(),$d);
} else {
- $SDL::App::USING_OPENGL = 0;
+ $SDLx::App::USING_OPENGL = 0;
}
my $self = SDL::Video::set_video_mode($w,$h,$d,$f)
@@ -161,7 +161,7 @@ sub loop ($$) {
sub sync ($) {
my $self = shift;
- if ($SDL::App::USING_OPENGL) {
+ if ($SDLx::App::USING_OPENGL) {
SDL::Video::GL_swap_buffers()
} else {
SDL::Video::flip($self);
@@ -170,12 +170,12 @@ sub sync ($) {
sub attribute ($$;$) {
my ($self,$mode,$value) = @_;
- return undef unless ($SDL::App::USING_OPENGL);
+ return undef unless ($SDLx::App::USING_OPENGL);
if (defined $value) {
SDL::Video::GL_set_attribute($mode,$value);
}
my $returns = SDL::Video::GL_get_attribute($mode);
- croak "SDL::App::attribute failed to get GL attribute" if ($$returns[0] < 0);
+ croak "SDLx::App::attribute failed to get GL attribute" if ($$returns[0] < 0);
$$returns[1];
}
File renamed without changes.
View
@@ -2,7 +2,7 @@
=head1 NAME
-SDL::App - a SDL perl extension
+SDLx::App - a SDL perl extension
=head1 CATEGORY
@@ -11,11 +11,11 @@ Extension
=head1 SYNOPSIS
use SDL;
- use SDL::App;
+ use SDLx::App;
use SDL::Event;
use SDL::Events;
- my $app = SDL::App->new(
+ my $app = SDLx::App->new(
-title => 'Application Title',
-width => 640,
-height => 480,
@@ -34,21 +34,21 @@ This is the manual way of doing things
exit if $type == SDL_QUIT;
}
-An alternative to the manual Event processing is the L<SDL::App::loop> .
+An alternative to the manual Event processing is the L<SDLx::App::loop> .
=head1 DESCRIPTION
-L<SDL::App> controls the root window of the of your SDL based application.
+L<SDLx::App> controls the root window of the of your SDL based application.
It extends the L<SDL::Surface> class, and provides an interface to the window
manager oriented functions.
=head1 METHODS
=head2 new
-C<SDL::App::new> initializes the SDL, creates a new screen,
+C<SDLx::App::new> initializes the SDL, creates a new screen,
and initializes some of the window manager properties.
-C<SDL::App::new> takes a series of named parameters:
+C<SDLx::App::new> takes a series of named parameters:
=over 4
@@ -88,41 +88,41 @@ C<SDL::App::new> takes a series of named parameters:
=head2 title
-C<SDL::App::title> takes 0, 1, or 2 arguments. It returns the current
+C<SDLx::App::title> takes 0, 1, or 2 arguments. It returns the current
application window title. If one parameter is passed, both the window
title and icon title will be set to its value. If two parameters are
passed the window title will be set to the first, and the icon title
to the second.
=head2 delay
-C<SDL::App::delay> takes 1 argument, and will sleep the application for
+C<SDLx::App::delay> takes 1 argument, and will sleep the application for
that many ms.
=head2 ticks
-C<SDL::App::ticks> returns the number of ms since the application began.
+C<SDLx::App::ticks> returns the number of ms since the application began.
=head2 error
-C<SDL::App::error> returns the last error message set by the SDL.
+C<SDLx::App::error> returns the last error message set by the SDL.
=head2 resize
-C<SDL::App::resize> takes a new height and width of the application
+C<SDLx::App::resize> takes a new height and width of the application
if the application was originally created with the -resizable option.
=head2 fullscreen
-C<SDL::App::fullscreen> toggles the application in and out of fullscreen mode.
+C<SDLx::App::fullscreen> toggles the application in and out of fullscreen mode.
=head2 iconify
-C<SDL::App::iconify> iconifies the applicaiton window.
+C<SDLx::App::iconify> iconifies the applicaiton window.
=head2 grab_input
-C<SDL::App::grab_input> can be used to change the input focus behavior of
+C<SDLx::App::grab_input> can be used to change the input focus behavior of
the application. It takes one argument, which should be one of the following:
=over 4
@@ -140,14 +140,14 @@ SDL_GRAB_OFF
=head2 loop
-C<SDL::App::loop> is a simple event loop method which takes a reference to a hash
+C<SDLx::App::loop> is a simple event loop method which takes a reference to a hash
of event handler subroutines. The keys of the hash must be SDL event types such
as SDL_QUIT(), SDL_KEYDOWN(), and the like. The event method recieves as its parameter
the event object used in the loop.
Example:
- my $app = SDL::App->new(
+ my $app = SDLx::App->new(
-title => "test.app",
-width => 800,
-height => 600,
@@ -163,13 +163,13 @@ Example:
=head2 sync
-C<SDL::App::sync> encapsulates the various methods of syncronizing the screen with the
-current video buffer. C<SDL::App::sync> will do a fullscreen update, using the double buffer
+C<SDLx::App::sync> encapsulates the various methods of syncronizing the screen with the
+current video buffer. C<SDLx::App::sync> will do a fullscreen update, using the double buffer
or OpenGL buffer if applicable. This is prefered to calling flip on the application window.
=head2 attribute ( attr, [value] )
-C<SDL::App::attribute> allows one to set and get GL attributes. By passing a value
+C<SDLx::App::attribute> allows one to set and get GL attributes. By passing a value
in addition to the attribute selector, the value will be set. C<SDL:::App::attribute>
always returns the current value of the given attribute, or croaks on failure.
@@ -30,7 +30,7 @@ For example, here is a very poorly implemented hack (read - don't do this at hom
use strict;
use SDL;
- use SDL::App;
+ use SDLx::App;
use SDL::Rect;
use SDL::Color;
use SDL::Video;
@@ -39,7 +39,7 @@ For example, here is a very poorly implemented hack (read - don't do this at hom
my $nib_size = 3;
# Create the SDL App
- my $app = SDL::App->new(
+ my $app = SDLx::App->new(
-width => 640,
-height => 480,
-depth => 16,
@@ -118,13 +118,13 @@ We next need to figure out how the application is actually going to run and disp
Here's some initialization code to get started; put this below the code already supplied above:
use SDL;
- use SDL::App;
+ use SDLx::App;
use SDL::Rect;
use SDL::Color;
use SDL::Video;
# Create the SDL App
- my $app = SDL::App->new( -width => $side_length, -height => $side_length,
+ my $app = SDLx::App->new( -width => $side_length, -height => $side_length,
-title => "Simple Simulation!", -depth => 16, );
# white particles on a black background
@@ -335,13 +335,13 @@ Before moving into getting user interaction, I first want to be sure we're worki
package main;
use SDL;
- use SDL::App;
+ use SDLx::App;
use SDL::Rect;
use SDL::Color;
use SDL::Video;
# Create the SDL App
- my $app = SDL::App->new( -width => $side_length, -height => $side_length,
+ my $app = SDLx::App->new( -width => $side_length, -height => $side_length,
-title => "Simple Simulation!", -depth => 16, );
# white particles on a black background
@@ -509,15 +509,15 @@ Just so that you've got a complete working example, here is the final state of t
package main;
use SDL;
- use SDL::App;
+ use SDLx::App;
use SDL::Rect;
use SDL::Color;
use SDL::Video;
use SDL::Event;
use SDL::Events;
# Create the SDL App
- my $app = SDL::App->new( -width => $side_length, -height => $side_length,
+ my $app = SDLx::App->new( -width => $side_length, -height => $side_length,
-title => "Simple Simulation!", -depth => 16, );
# white particles on a black background
@@ -9,7 +9,7 @@ GFX
=head1 DESCRIPTION
All functions take an SDL::Surface object as first parameter. This can be a new surface that will be blittet afterwads, can be an surface
-obtained by L<SDL::Video::set_video_mode> or can be an L<SDL::App>.
+obtained by L<SDL::Video::set_video_mode> or can be an L<SDLx::App>.
The C<color> values for the C<_color> functions are C<0xRRGGBBAA> (32bit), even if the surface uses e. g. 8bit colors.
@@ -67,6 +67,6 @@ David J. Goehrig
=head1 SEE ALSO
-L<perl> L<SDL::App>
+L<perl> L<SDLx::App>
=cut
@@ -26,7 +26,7 @@ though. Here's how to get up and running as quickly as possible.
=head2 Surfaces
All graphics in SDL live on a surface. You'll need at least one. That's what
-L<SDL::App> provides.
+L<SDLx::App> provides.
Of course, before you can get a surface, you need to initialize your video
mode. SDL gives you several options, including whether to run in a window or
@@ -36,12 +36,12 @@ something really simple.
=head2 Initialization
-SDL::App makes it easy to initialize video and create a surface. Here's how to
+SDLx::App makes it easy to initialize video and create a surface. Here's how to
ask for a windowed surface with 640x480x16 resolution:
- use SDL::App;
+ use SDLx::App;
- my $app = SDL::App->new(
+ my $app = SDLx::App->new(
-width => 640,
-height => 480,
-depth => 16,
@@ -51,9 +51,9 @@ You can get more creative, especially if you use the C<-title> and C<-icon>
attributes in a windowed application. Here's how to set the window title of
the application to C<My SDL Program>:
- use SDL::App;
+ use SDLx::App;
- my $app = SDL::App->new(
+ my $app = SDLx::App->new(
-height => 640,
-width => 480,
-depth => 16,
Oops, something went wrong. Retry.

0 comments on commit c3d720d

Please sign in to comment.