From: kthakore Date: Tue, 31 Aug 2010 21:28:34 +0000 (+0000) Subject: up X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e1ec9f6e00ef090d063bc417e9683d40fc49b26f;p=sdlgit%2FSDL-Site.git up --- diff --git a/pages/SDLx-App.html-inc b/pages/SDLx-App.html-inc index ca61336..2ed4ee3 100644 --- a/pages/SDLx-App.html-inc +++ b/pages/SDLx-App.html-inc @@ -8,7 +8,10 @@
  • DESCRIPTION
  • METHODS +
  • +
  • METHODS +
  • +
  • CALLBACKS
  • AUTHORS
  • SEE ALSO
  • @@ -105,9 +108,9 @@ Any flags you want to pass to SDL::Video upon initi Set this to a true value to make the window resizeable by the user. Default is off. - - - + +

    METHODS

    Top

    +

    title()

    @@ -170,30 +173,6 @@ the application. It takes one argument, which should be one of the following:

    -

    loop( \%actions )

    -
    -

    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. When called, the event method recieves -as its parameter the event object used in the loop.

    -

    Example:

    -
        my $app = SDLx::App->new(
    -        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 );
    -
    -
    - -

    sync

    SDLx::App::sync encapsulates the various methods of syncronizing the screen with the @@ -212,6 +191,31 @@ in addition to the attribute selector, the value will be set. SDL:::App::a always returns the current value of the given attribute, or croaks on failure.

    +

    CALLBACKS

    Top

    +
    +

    SDLx::App is a SDLx::Controller. Use the event, show and handlers to run the app.

    +
      use SDL;
    +  use SDLx::App;
    +
    +  use SDL::Event; #Where ever the event call back is processed
    +
    +  my $app = SDLx::App->new( width => 200, height => 200);
    +
    +  $app->add_event_handler( sub{ return 0 if $_[0]->type == SDL_QUIT; return 1});
    +
    +  $app->add_show_handler( sub{ $app->update() } );
    +
    +  $app->add_move_handler( 
    +  sub{ 
    +  #calc your physics here 
    +  } );
    +
    +  $app->run();
    +
    +
    +

    see SDLx::Controller for more details.

    + +

    AUTHORS

    Top

    See AUTHORS in SDL.

    diff --git a/pages/documentation.html-inc b/pages/documentation.html-inc index 7630ff9..6fa7069 100644 --- a/pages/documentation.html-inc +++ b/pages/documentation.html-inc @@ -1,2 +1,2 @@
    -

    Documentation (latest development branch)

    Core
    thumbSDL- Simple DirectMedia Layer for Perl
    thumbSDL::Credits- Authors and contributors of the SDL Perl project
    thumbSDL::Deprecated- Log of Deprecated items per release
    thumbSDL::Time- An SDL Perl extension for managing timers
    Audio
    thumbSDL::Audio- SDL Bindings for Audio
    Structure
    thumbSDL::AudioCVT- Audio Conversion Structure
    thumbSDL::AudioSpec- SDL Bindings for structure SDL::AudioSpec
    CDROM
    thumbSDL::CDROM- SDL Bindings for the CDROM device
    Structure
    thumbSDL::CD- SDL Bindings for structure SDL_CD
    thumbSDL::CDTrack- SDL Bindings for structure SDL_CDTrack
    Events
    thumbSDL::Events- Bindings to the Events Category in SDL API
    Structure
    thumbSDL::Event- General event structure
    Joystick
    thumbSDL::Joystick- SDL Bindings for the Joystick device
    Mouse
    thumbSDL::Mouse- SDL Bindings for the Mouse device
    Structure
    thumbSDL::Cursor- Mouse cursor structure
    Structure
    thumbSDL::Version- SDL Bindings for structure SDL_Version
    Video
    thumbSDL::Video- Bindings to the video category in SDL API
    Structure
    thumbSDL::Color- Format independent color description
    thumbSDL::Overlay- YUV Video overlay
    thumbSDL::Palette- Color palette for 8-bit pixel formats
    thumbSDL::PixelFormat- Stores surface format information
    thumbSDL::Rect- Defines a rectangular area
    thumbSDL::Surface- Graphic surface structure
    thumbSDL::VideoInfo- Video Target Information

    Cookbook
    thumbSDL::Cookbook
    thumbSDL::Cookbook::OpenGL- Using SDL with OpenGL
    thumbSDL::Cookbook::PDL

    Extension
    thumbSDLx::App- a SDL perl extension
    thumbSDLx::Layer- Storage object for surface and position information
    thumbSDLx::LayerManager- Extension for managing layers in a 2D world
    thumbSDLx::Rect- SDL extension for storing and manipulating rectangular coordinates
    thumbSDLx::SFont- Extension making fonts out of images and printing them
    thumbSDLx::Sprite- interact with images quick and easily in SDL
    thumbSDLx::Sprite::Animated- create animated SDL sprites easily!
    thumbSDLx::Surface- Graphic surface matrix extension

    GFX
    thumbSDL::GFX::Framerate- framerate calculating functions
    thumbSDL::GFX::Primitives- basic drawing functions
    Structure
    thumbSDL::GFX::FPSManager- data structure used by SDL::GFX::Framerate

    Image
    thumbSDL::Image- Bindings for the SDL_Image library

    Mixer
    thumbSDL::Mixer- Sound and music functions
    thumbSDL::Mixer::Channels- SDL::Mixer channel functions and bindings
    thumbSDL::Mixer::Effects- sound effect functions
    thumbSDL::Mixer::Groups- Audio channel group functions
    thumbSDL::Mixer::Music- functions for music
    thumbSDL::Mixer::Samples- functions for loading sound samples
    Structure
    thumbSDL::Mixer::MixChunk- SDL Bindings for structure SDL_MixChunk
    thumbSDL::Mixer::MixMusic- SDL Bindings for structure SDL_MixMusic

    Pango
    thumbSDL::Pango- Text rendering engine
    Structure
    thumbSDL::Pango::Context- Context object for SDL::Pango

    TODO
    thumbSDL::MPEG- a SDL perl extension
    thumbSDL::SMPEG- a SDL perl extension
    MultiThread
    thumbSDL::MultiThread- Bindings to the MultiThread category in SDL API
    Structure
    thumbSDL::RWOps- SDL Bindings to SDL_RWOPs
    GFX
    thumbSDL::GFX::BlitFunc- blitting functions
    thumbSDL::GFX::ImageFilter- image filtering functions
    thumbSDL::GFX::Rotozoom- rotation and zooming functions for surfaces

    TTF
    thumbSDL::TTF- True Type Font functions (libfreetype)
    Structure
    thumbSDL::TTF::Font- Font object type for SDL_ttf

    Tutorials
    thumbSDL::Tutorial- introduction to Perl SDL
    thumbSDL::Tutorial::Animation
    thumbSDL::Tutorial::LunarLander- a small tutorial on Perl SDL

    UNCATEGORIZED
    thumbSDLx::Controller- Handles the loops for event, movement and rendering
    +

    Documentation (latest development branch)

    Core
    thumbSDL- Simple DirectMedia Layer for Perl
    thumbSDL::Credits- Authors and contributors of the SDL Perl project
    thumbSDL::Deprecated- Log of Deprecated items per release
    thumbSDL::Time- An SDL Perl extension for managing timers
    Audio
    thumbSDL::Audio- SDL Bindings for Audio
    Structure
    thumbSDL::AudioCVT- Audio Conversion Structure
    thumbSDL::AudioSpec- SDL Bindings for structure SDL::AudioSpec
    CDROM
    thumbSDL::CDROM- SDL Bindings for the CDROM device
    Structure
    thumbSDL::CD- SDL Bindings for structure SDL_CD
    thumbSDL::CDTrack- SDL Bindings for structure SDL_CDTrack
    Events
    thumbSDL::Events- Bindings to the Events Category in SDL API
    Structure
    thumbSDL::Event- General event structure
    Joystick
    thumbSDL::Joystick- SDL Bindings for the Joystick device
    Mouse
    thumbSDL::Mouse- SDL Bindings for the Mouse device
    Structure
    thumbSDL::Cursor- Mouse cursor structure
    Structure
    thumbSDL::Version- SDL Bindings for structure SDL_Version
    Video
    thumbSDL::Video- Bindings to the video category in SDL API
    Structure
    thumbSDL::Color- Format independent color description
    thumbSDL::Overlay- YUV Video overlay
    thumbSDL::Palette- Color palette for 8-bit pixel formats
    thumbSDL::PixelFormat- Stores surface format information
    thumbSDL::Rect- Defines a rectangular area
    thumbSDL::Surface- Graphic surface structure
    thumbSDL::VideoInfo- Video Target Information

    Cookbook
    thumbSDL::Cookbook
    thumbSDL::Cookbook::OpenGL- Using SDL with OpenGL
    thumbSDL::Cookbook::PDL

    Extension
    thumbSDLx::App- a SDL perl extension
    thumbSDLx::Layer- Storage object for surface and position information
    thumbSDLx::LayerManager- Extension for managing layers in a 2D world
    thumbSDLx::Rect- SDL extension for storing and manipulating rectangular coordinates
    thumbSDLx::SFont- Extension making fonts out of images and printing them
    thumbSDLx::Sprite- interact with images quick and easily in SDL
    thumbSDLx::Sprite::Animated- create animated SDL sprites easily!
    thumbSDLx::Surface- Graphic surface matrix extension

    GFX
    thumbSDL::GFX::Framerate- framerate calculating functions
    thumbSDL::GFX::Primitives- basic drawing functions
    Structure
    thumbSDL::GFX::FPSManager- data structure used by SDL::GFX::Framerate

    Image
    thumbSDL::Image- Bindings for the SDL_Image library

    Mixer
    thumbSDL::Mixer- Sound and music functions
    thumbSDL::Mixer::Channels- SDL::Mixer channel functions and bindings
    thumbSDL::Mixer::Effects- sound effect functions
    thumbSDL::Mixer::Groups- Audio channel group functions
    thumbSDL::Mixer::Music- functions for music
    thumbSDL::Mixer::Samples- functions for loading sound samples
    Structure
    thumbSDL::Mixer::MixChunk- SDL Bindings for structure SDL_MixChunk
    thumbSDL::Mixer::MixMusic- SDL Bindings for structure SDL_MixMusic

    Pango
    thumbSDL::Pango- Text rendering engine
    Structure
    thumbSDL::Pango::Context- Context object for SDL::Pango

    TODO
    thumbSDL::MPEG- a SDL perl extension
    thumbSDL::SMPEG- a SDL perl extension
    MultiThread
    thumbSDL::MultiThread- Bindings to the MultiThread category in SDL API
    Structure
    thumbSDL::RWOps- SDL Bindings to SDL_RWOPs
    GFX
    thumbSDL::GFX::BlitFunc- blitting functions
    thumbSDL::GFX::ImageFilter- image filtering functions
    thumbSDL::GFX::Rotozoom- rotation and zooming functions for surfaces

    TTF
    thumbSDL::TTF- True Type Font functions (libfreetype)
    Structure
    thumbSDL::TTF::Font- Font object type for SDL_ttf

    Tutorials
    thumbSDL::Tutorial- introduction to Perl SDL
    thumbSDL::Tutorial::Animation
    thumbSDL::Tutorial::LunarLander- a small tutorial on Perl SDL

    UNCATEGORIZED
    thumbSDLx::Controller- Handles the loops for event, movement and rendering