Merge git://github.com/FROGGS/SDL_perl into redesign
[sdlgit/SDL_perl.git] / lib / SDL / App.pm
index 0105eee..86e4ea4 100644 (file)
@@ -112,7 +112,7 @@ sub new {
                $SDL::App::USING_OPENGL = 0;
        }
 
-       my $self = \SDL::SetVideoMode($w,$h,$d,$f)
+       my $self = SDL::SetVideoMode($w,$h,$d,$f)
                or croak SDL::GetError();
        
        if ($ic and -e $ic) {
@@ -195,7 +195,7 @@ sub sync ($) {
        if ($SDL::App::USING_OPENGL) {
                SDL::GLSwapBuffers()
        } else {
-               $self->flip();
+               SDL::Flip($self);
        }
 }
 
@@ -221,17 +221,35 @@ __END__;
 SDL::App - a SDL perl extension
 
 =head1 SYNOPSIS
-
-       my $app = new SDL::App (
-               -title => 'Application Title',
-               -width => 640, 
-               -height => 480,
-               -depth => 32 );
+               
+       use SDL;
+       use SDL::Event; 
+       use SDL::App; 
+        
+       my $app = new SDL::App ( 
+       -title => 'Application Title', 
+       -width => 640, 
+       -height => 480, 
+       -depth => 32 ); 
+
+This is the manual way of doing things 
+
+       my $event = new SDL::Event;             # create a new event 
+
+       $event->pump();
+       $event->poll();
+
+       while ($event->wait()) { 
+         my $type = $event->type();      # get event type 
+         print $type; 
+         exit if $type == SDL_QUIT; 
+         }
+An alternative to the manual Event processing is the L<SDL::App::loop> .
 
 =head1 DESCRIPTION
 
 L<SDL::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
+It extends the L<SDL::Surface> class, and provides an interface to the window
 manager oriented functions.
 
 =head1 METHODS