X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=htdocs%2Fassets%2FSDL-App.html-inc;fp=htdocs%2Fassets%2FSDL-App.html-inc;h=0000000000000000000000000000000000000000;hb=26efac5f5d9248a3074667d4a33d01ee0b7092c8;hp=8d6e4243f8a05906a7e71eb388227e3d8fe6f562;hpb=3b2b2b29d49f57274246f49728b4a16b2b56a626;p=sdlgit%2FSDL-Site.git diff --git a/htdocs/assets/SDL-App.html-inc b/htdocs/assets/SDL-App.html-inc deleted file mode 100644 index 8d6e424..0000000 --- a/htdocs/assets/SDL-App.html-inc +++ /dev/null @@ -1,195 +0,0 @@ -
SDL::App - a SDL perl extension
- -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> . - -- -
SDL::App controls the root window of the of your SDL based application. -It extends the SDL::Surface class, and provides an interface to the window -manager oriented functions.
- -SDL::App::new
initializes the SDL, creates a new screen,
-and initializes some of the window manager properties.
-SDL::App::new
takes a series of named parameters:
SDL::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.
SDL::App::delay
takes 1 argument, and will sleep the application for
-that many ms.
SDL::App::ticks
returns the number of ms since the application began.
SDL::App::error
returns the last error message set by the SDL.
SDL::App::resize
takes a new height and width of the application
-if the application was originally created with the -resizable option.
SDL::App::fullscreen
toggles the application in and out of fullscreen mode.
SDL::App::iconify
iconifies the applicaiton window.
SDL::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:
SDL::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 = new SDL::App -title => "test.app", - -width => 800, - -height => 600, - -depth => 32; - - my %actions = ( - SDL_QUIT() => sub { exit(0); }, - SDL_KEYDOWN() => sub { print "Key Pressed" }, - ); - - $app->loop(\%actions); - -- -
SDL::App::sync
encapsulates the various methods of syncronizing the screen with the
-current video buffer. SDL::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.
SDL::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. SDL:::App::attribute
-always returns the current value of the given attribute, or croaks on failure.
David J. Goehrig -Kartik Thakore
- -perl SDL::Surface SDL::Event SDL::OpenGL
- -