From: kthakore Date: Mon, 23 Aug 2010 13:54:34 +0000 (+0000) Subject: Added new stuff X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=285d0cd289790209bcd9d141d63fd6fce74a2ee4;p=sdlgit%2FSDL-Site.git Added new stuff --- diff --git a/pages/SDLx-App.html-inc b/pages/SDLx-App.html-inc index b1f6592..72ae752 100644 --- a/pages/SDLx-App.html-inc +++ b/pages/SDLx-App.html-inc @@ -8,17 +8,20 @@
  • DESCRIPTION
  • METHODS
  • AUTHOR
  • @@ -52,7 +55,7 @@ ); -

    This is the manual way of doing things

    +

    This is the manual way of doing things

        my $event = SDL::Event->new; # create a new event 
     
         SDL::Events::pump_events();
    @@ -64,7 +67,7 @@
         }
     
     
    -

    An alternative to the manual Event processing is the SDLx::App::loop .

    +

    An alternative to the manual Event processing is the SDLx::App::loop.

    DESCRIPTION

    Top

    @@ -83,30 +86,41 @@ manager oriented functions.

    SDLx::App::new initializes the SDL, creates a new screen, and initializes some of the window manager properties. SDLx::App::new takes a series of named parameters:

    - +
    +
    * title
    +
    * icon_title
    +
    * icon
    +
    * width
    +
    * height
    +
    * depth
    +
    * flags
    +
    * resizeable
    +
    + + + -

    title

    +

    title()

    -

    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.

    -

    delay

    -
    +

    title( $new_title )

    +
    + +
    +

    title( $window_title, $icon_title )

    +
    +

    SDLx::App::title takes 0, 1, or 2 arguments. If no parameter is given, +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.

    + +
    +

    delay( $ms )

    +

    SDLx::App::delay takes 1 argument, and will sleep the application for that many ms.

    @@ -121,10 +135,10 @@ that many ms.

    SDLx::App::error returns the last error message set by the SDL.

    -

    resize

    -
    -

    SDLx::App::resize takes a new height and width of the application -if the application was originally created with the resizable option.

    +

    resize( $width, $height )

    +
    +

    SDLx::App::resize takes a new width and height of the application. Only +works if the application was originally created with the resizable option.

    fullscreen

    @@ -134,29 +148,26 @@ if the application was originally created with the resizable option.

    iconify

    -

    SDLx::App::iconify iconifies the applicaiton window.

    +

    SDLx::App::iconify iconifies the application window.

    -

    grab_input

    -
    +

    grab_input( $CONSTANT )

    +

    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:

    +the application. It takes one argument, which should be one of the following:

    -
    * -SDL_GRAB_QUERY
    -
    * -SDL_GRAB_ON
    -
    * -SDL_GRAB_OFF
    +
    * SDL_GRAB_QUERY
    +
    * SDL_GRAB_ON
    +
    * SDL_GRAB_OFF
    -

    loop

    -
    +

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

    +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", 
    @@ -178,14 +189,18 @@ the event object used in the loop.

    sync

    SDLx::App::sync encapsulates the various methods of syncronizing the screen with the -current video buffer. 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.

    +current video buffer. 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.

    + +
    +

    attribute( $attr )

    +
    -

    attribute ( attr, [value] )

    +

    attribute( $attr, $value )

    -

    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. SDL:::App::attribute +

    SDLx::App::attribute allows one to get and set 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.

    diff --git a/pages/SDLx-Layer.html-inc b/pages/SDLx-Layer.html-inc new file mode 100644 index 0000000..556b041 --- /dev/null +++ b/pages/SDLx-Layer.html-inc @@ -0,0 +1,164 @@ +
    + +

    Index

    + +
    + + +

    NAME

    Top

    +
    +

    SDLx::Layer - Extension ...

    + +
    +

    CATEGORY

    Top

    +
    +

    Extension

    + +
    +

    SYNOPSIS

    Top

    +
    +
      use SDLx::Layer;
    +  use SDLx::LayerManager;
    +
    +
    + +
    +

    DESCRIPTION

    Top

    +
    + + + + + +
    +

    METHODS

    Top

    +
    + +
    +

    new

    +
    + +
    +

    index

    +
    + +
    +

    x

    +
    + +
    +

    y

    +
    + +
    +

    w

    +
    + +
    +

    h

    +
    + +
    +

    surface

    +
    + +
    +

    clip

    +
    + +
    +

    pos

    +
    + +
    +

    data

    +
    + +
    +

    ahead

    +
    + +
    +

    behind

    +
    + +
    +

    attach

    +
    + +
    +

    detach_xy

    +
    + +
    +

    foreground

    +
    + +
    +

    BUGS

    Top

    +
    +

    Report at sdlperl.ath.cx

    + +
    +

    SUPPORT

    Top

    +
    +

    #sdl irc.perl.org

    + +
    +

    AUTHOR

    Top

    +
    +
        Tobias Leich
    +    CPAN ID: FROGGS
    +    ---
    +    froggs@cpan.org
    +    http://sdl.perl.org
    +
    +
    + +
    +

    COPYRIGHT

    Top

    + +

    SEE ALSO

    Top

    +
    +

    perl(1), SDL(2).

    + +
    +
    \ No newline at end of file diff --git a/pages/SDLx-LayerManager.html-inc b/pages/SDLx-LayerManager.html-inc new file mode 100644 index 0000000..5429bca --- /dev/null +++ b/pages/SDLx-LayerManager.html-inc @@ -0,0 +1,174 @@ +
    + +

    Index

    + +
    + + +

    NAME

    Top

    +
    +

    SDLx::LayerManager - Extension for managing layers in a 2D world

    + +
    +

    CATEGORY

    Top

    +
    +

    Extension

    + +
    +

    SYNOPSIS

    Top

    +
    +
      use SDLx::Layer;
    +  use SDLx::LayerManager;
    +
    +  use SDL::Image;
    +  use SDL::Surface;
    +  use SDL::Video;
    +
    +  # creating layers
    +  my $layer1 = SDLx::Layer->new( SDL::Image::load('image1.png'), {userdata => '7'} );
    +  my $layer2 = SDLx::Layer->new( SDL::Image::load('image2.png'), 100, 200, {userdata => '42'} );
    +
    +  # creating the manager that holds the layers
    +  my $layermanager = SDLx::LayerManager->new();
    +  $layermanager->add( $layer1 );
    +  $layermanager->add( $layer2 );
    +
    +  my $display = # create your video surface here
    +
    +  $layermanager->blit( $display );
    +
    +  # accessing the layer at point(x,y)
    +  print( $layermanager->by_position( 150, 200 )->data->{userdata} ); # should print '42'
    +
    +
    + +
    +

    DESCRIPTION

    Top

    +
    +

    The LayerManager ...

    + +
    +

    METHODS

    Top

    +
    + +
    +

    new

    +
    + +
    +

    add

    +
    + +
    +

    layers

    +
    + +
    +

    layer

    +
    + +
    +

    length

    +
    + +
    +

    blit

    +
    + +
    +

    by_position

    +
    +
      my $layer = $layermanager->by_position( $x, $y );
    +
    +
    + +
    +

    ahead

    +
    + +
    +

    behind

    +
    + +
    +

    attach

    +
    + +
    +

    detach_xy

    +
    + +
    +

    detach_back

    +
    + +
    +

    foreground

    +
    + +
    +

    BUGS

    Top

    +
    +

    Report at sdlperl.ath.cx

    + +
    +

    SUPPORT

    Top

    +
    +

    #sdl irc.perl.org

    + +
    +

    AUTHOR

    Top

    +
    +
        Tobias Leich
    +    CPAN ID: FROGGS
    +    ---
    +    froggs@cpan.org
    +    http://sdl.perl.org
    +
    +
    + +
    +

    COPYRIGHT

    Top

    + +

    SEE ALSO

    Top

    +
    +

    perl(1), SDL(2).

    + +
    +
    \ No newline at end of file diff --git a/pages/SDLx-Sound.html-inc b/pages/SDLx-Sound.html-inc new file mode 100644 index 0000000..cb21361 --- /dev/null +++ b/pages/SDLx-Sound.html-inc @@ -0,0 +1,225 @@ +
    + +

    Index

    + +
    + + +

    NAME

    Top

    +
    +

    SDLx::Sound

    + +
    +

    VERSION

    Top

    +
    +

    Version 0.01_01

    + + + + + +
    +

    SYNOPSIS

    Top

    +
    +
        use SDLx::Sound;
    +
    +    my $snd = SDLx::Sound->new();
    +
    +    # loads and plays a single sound now
    +    $snd->play('myfile.wav');
    +
    +    # load a single file
    +    $snd->load('theSound.aif');
    +
    +    # plays it or all loaded files
    +    $snd->play();
    +
    +    # more sounds
    +    my %files = (
    +        chanell_01 => "/my_sound1.wav",
    +        chanell_02 => "/my_sound2.ogg"
    +    );
    +
    +    # times sounds bangs
    +    my %times = (
    +        chanell_01 => 0,      # start
    +        chanell_01 => 1256,   # miliseconds
    +        chanell_02 => 2345
    +    );
    +
    +    # Load files in channels for realtime play
    +    $snd->load(%files);
    +
    +    # sets sound channel_01 loudness
    +    $snd->loud('channel_01', 80);       # loud at 80%
    +    $snd->play(%times);                 # play loaded files at times
    +    $snd->play;                         # play again
    +
    +    # plays sound channel_01 at 578 miliseconds from now
    +    $snd->play('channel_01', 578);
    +
    +    # fades sound 
    +    $snd->fade('channel_02', 2345, 3456, -20);
    +
    +    # in a single act do the wole Sound
    +    my $snd = SDLx::Sound->new(
    +        files => (
    +            chanell_01 => "/my_sound1.wav",
    +            chanell_02 => "/my_sound2.ogg"
    +
    +        ), 
    +        loud  => (
    +            channel_01 => 80,
    +            channel_02 => 75
    +        ),
    +        times => (
    +            chanell_01 => 0,      # start
    +            chanell_01 => 1256,   # miliseconds
    +            chanell_02 => 2345
    +        ),
    +        fade  => (
    +            chanell_02 => [2345, 3456, -20]
    +        )
    +    )->play();
    +
    +
    + +
    +

    DESCRIPTION

    Top

    +
    + + + + +

    You can think about the SDLx::Sound at 2 aproaches.

    +
    +
    * A simple sound or
    +
    * The sound of your game or app.
    +
    +

    Your application will say what the best aproach.

    +

    In a taste that resembles to perl and to SDL, our SDLx:Sound hooks at SDL::Audio and SDL::Mixer with a gracefull and simple interface that can offer to monks a modern perlish way to manage sounds.

    +

    An SDLx::Sound object can load sounds from filesystem, play it, adjust this loudness level or stops the sound.

    +

    Each sound will play in the next available channel, so it can be handled isolately.

    + +
    +

    METHODS

    Top

    +
    + +
    +

    new

    +
    +

    Returns a new instance of SDLx::Sound

    + +
    +

    load

    +
    + +
    +

    play

    +
    + +
    +

    loud

    +
    + +
    +

    stop

    +
    + +
    +

    AUTHOR

    Top

    +
    +

    Monsenhor, <ricardo.filipo at mitologica.com.br>

    + +
    +

    BUGS

    Top

    +
    +

    Please report any bugs or feature requests to bug-sdlx-sound at rt.cpan.org, or through +the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=SDLx-Sound. I will be notified, and then you'll +automatically be notified of progress on your bug as I make changes.

    + + + + + + + + + + + +
    +

    SUPPORT

    Top

    +
    +

    You can find documentation for this module with the perldoc command.

    +
        perldoc SDLx::Sound
    +
    +
    +
    +
    +
    +

    You can also look for information at:

    +
    +
    * RT: CPAN's request tracker
    +
    +

    http://rt.cpan.org/NoAuth/Bugs.html?Dist=SDLx-Sound

    +
    +
    * AnnoCPAN: Annotated CPAN documentation
    +
    +

    http://annocpan.org/dist/SDLx-Sound

    +
    +
    * CPAN Ratings
    +
    +

    http://cpanratings.perl.org/d/SDLx-Sound

    +
    +
    * Search CPAN
    +
    +

    http://search.cpan.org/dist/SDLx-Sound/

    +
    +
    + + + + + +
    +

    ACKNOWLEDGEMENTS

    Top

    +
    + + + + + +
    +

    LICENSE AND COPYRIGHT

    Top

    + +
    \ No newline at end of file diff --git a/pages/SDLx-Sprite-Animated.html-inc b/pages/SDLx-Sprite-Animated.html-inc index b1bd058..1cb7575 100644 --- a/pages/SDLx-Sprite-Animated.html-inc +++ b/pages/SDLx-Sprite-Animated.html-inc @@ -20,6 +20,8 @@
  • ticks_per_frame( $integer )
  • type()
  • type( $string )
  • +
  • set_sequences( $string => [ [ $x1, $y1 ], [ $x2, $y2 ], ... ], ... )
  • +
  • sequence( $string )
  • next()
  • previous()
  • reset()
  • @@ -184,6 +186,14 @@ the next frame during autoplay (i.e. between calls to start() and stop()).

    frame in the strip. See the type() method below for information on available looping types.

    +
    * sequences => { $string => [ [ $x1, $y1 ], [ $x2, $y2 ], ... ], ... }
    +
    +

    Uses the supplied hashref to define named sequences of frames.

    +
    +
    * sequence => $string
    +
    +

    Uses $string to set the current sequence.

    +
    @@ -261,6 +271,18 @@ to be lowercase.

    Default value is 'circular'.

    +

    set_sequences( $string => [ [ $x1, $y1 ], [ $x2, $y2 ], ... ], ... )

    +
    +

    Uses the supplied hashref to define named sequences of frames. Replaces any +previously defined sequences.

    + +
    +

    sequence( $string )

    +
    +

    Uses $string to set the current sequence. Goes to the first frame in the +sequence and resets the loop counter.

    + +

    next()

    Goes to the next frame in the strip. Calling this method will also reset diff --git a/pages/SDLx-Surface.html-inc b/pages/SDLx-Surface.html-inc index e2b5196..9a7db49 100644 --- a/pages/SDLx-Surface.html-inc +++ b/pages/SDLx-Surface.html-inc @@ -26,6 +26,7 @@

  • update
  • draw_rect
  • draw_line
  • +
  • draw_gfx_text
  • AUTHOR @@ -225,6 +226,27 @@ This is useful when the surface you have isn't an SDLx::Surface, bu

    Returns $self

  • +

    draw_gfx_text

    +
    +

    Draw text using gfx (not pretty but fast) at give vector, color.

    +
     $surf->draw_gfx_text( [0,0], 0xffffffff, "fooo");
    + $surf->draw_gfx_text( [10,10], [20,20,20,20], "fooo");
    +
    +
    +

    You can also set the gfx font but passing a hash reference as shown below.

    +
     my $f = '';
    + open( my $FH, '<', 'test/data/5x7.fnt');
    + binmode ($FH);
    + read($FH, $f, 4096);
    + close ($FH);
    +
    + my $font =  {data=>$f, cw => 5, ch => 7};
    + $surf->draw_gfx_text( [0,0], 0xffffffff, "fooo", $font );
    +
    +
    +

    Returns $self

    + +

    AUTHOR

    Top

     kthakore 
    diff --git a/pages/documentation.html-inc b/pages/documentation.html-inc
    index 605e3bc..f8096f2 100644
    --- a/pages/documentation.html-inc
    +++ b/pages/documentation.html-inc
    @@ -1,2 +1,2 @@
     
    -

    Documentation (latest development branch)

    +

    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- Extension ...
    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
    thumbSDLx::Sound