From: Tobias Leich Date: Tue, 4 May 2010 19:42:00 +0000 (+0200) Subject: updated docs and path to my repo X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f373167ec31ba16ae0770ba461f9de43f41a7ac1;p=sdlgit%2FSDL-Site.git updated docs and path to my repo --- diff --git a/pages/SDL-App.html-inc b/pages/SDL-App.html-inc index 2e3ac92..10356be 100644 --- a/pages/SDL-App.html-inc +++ b/pages/SDL-App.html-inc @@ -39,31 +39,32 @@

SYNOPSIS

Top

-
	use SDL;
-	use SDL::Event; 
-	use SDL::App; 
-
-	my $app = new SDL::App ( 
-	-title => 'Application Title', 
-	-width => 640, 
-	-height => 480, 
-	-depth => 32 ); 
+
    use SDL;
+    use SDL::App; 
+    use SDL::Event;
+    use SDL::Events; 
+
+    my $app = SDL::App->new( 
+        -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 
+
    my $event = SDL::Event->new; # create a new event 
 
-	$event->pump();
-	$event->poll();
+    SDL::Events::pump_events();
 
-	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> .
+    while ( SDL::Events::poll_event($event) ) { 
+        my $type = $event->type(); # get event type 
+        print $type; 
+        exit if $type == SDL_QUIT; 
+    }
 
 
+

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

DESCRIPTION

Top

@@ -156,19 +157,20 @@ SDL_GRAB_OFF 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);
+

Example:

+
    my $app = SDL::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 );
 
 
diff --git a/pages/SDL-Cookbook-PDL.html-inc b/pages/SDL-Cookbook-PDL.html-inc index 5d4c847..6344860 100644 --- a/pages/SDL-Cookbook-PDL.html-inc +++ b/pages/SDL-Cookbook-PDL.html-inc @@ -424,7 +424,7 @@ Some of the particles can drift off the screen. This is no good. What's causing

and then be sure to create an event object amongst the animation initialization code:

-
 my $event = new SDL::Event;
+
 my $event = SDL::Event->new;
 
 

Finally, we need to update the application loop so that it examines and responds to events. Replace the current application loop with this code:

@@ -579,7 +579,7 @@ Some of the particles can drift off the screen. This is no good. What's causing my $bg = SDL::Rect->new( 0,0,$side_length, $side_length, ); # event listener - my $event = new SDL::Event->new(); + my $event = SDL::Event->new(); # event dispatch table my $keyname_dispatch_table = { diff --git a/pages/SDL-Credits.html-inc b/pages/SDL-Credits.html-inc index cbe7cb2..2eb12e0 100644 --- a/pages/SDL-Credits.html-inc +++ b/pages/SDL-Credits.html-inc @@ -2,7 +2,8 @@

Index

-

They can be reached on the SDL-devel\@perl.org mailing list and the #sdl channel on the irc.perl.org network.

- - - - \ No newline at end of file diff --git a/pages/SDL-MPEG.html-inc b/pages/SDL-MPEG.html-inc index 35a7d30..0633e7c 100644 --- a/pages/SDL-MPEG.html-inc +++ b/pages/SDL-MPEG.html-inc @@ -21,7 +21,7 @@

SYNOPSIS

Top

-
  $info = new SDL::MPEG -from => $mpeg;
+
  $info = SDL::MPEG->new( -from => $mpeg );
 
 
diff --git a/pages/SDL-Mixer-Music.html-inc b/pages/SDL-Mixer-Music.html-inc index a7a9ec8..f6550f1 100644 --- a/pages/SDL-Mixer-Music.html-inc +++ b/pages/SDL-Mixer-Music.html-inc @@ -244,7 +244,9 @@ Passing zero is similar to rewinding the song.

Jumps to position seconds from the current position in the stream. So you may want to call SDL::Mixer::Music::rewind_music before this. Does not go in reverse... negative values do nothing.

-

Returns: 0 on success, or -1 if the codec doesn't support this function.

+ + +

Returns: 0 on success, or -1 if the codec doesn't support this function.

paused_music

@@ -252,7 +254,7 @@ Does not go in reverse... negative values do nothing.

 my $paused = SDL::Mixer::Music::paused_music();
 
 
-

Returns 1 if the music is paused, otherwise 0.

+

Returns 1 if the music is paused, otherwise 0.

playing_music

@@ -260,12 +262,12 @@ Does not go in reverse... negative values do nothing.

 my $playing_music = SDL::Mixer::Music::playing_music();
 
 
-

Returns 1 if the music is playing sound, otherwise 0. It does'nt check if the music is paused.

+

Returns 1 if the music is playing sound, otherwise 0. It does'nt check if the music is paused.

AUTHOR

Top

-

Tobias Leich [FROGGS]

+

Tobias Leich [FROGGS]

\ No newline at end of file diff --git a/pages/SDL-Music.html-inc b/pages/SDL-Music.html-inc index 4f4f651..a913597 100644 --- a/pages/SDL-Music.html-inc +++ b/pages/SDL-Music.html-inc @@ -20,7 +20,7 @@

SDL::Music is used to load music files for use with SDL::Mixer. To load a music file one simply creates a new object passing the filename to the constructor:

-
	my $music = new SDL::Music 'my_song.ogg';
+
	my $music = SDL::Music->new(  'my_song.ogg' );
 
 
 
diff --git a/pages/SDL-Pango-Context.html-inc b/pages/SDL-Pango-Context.html-inc
index a03fd0b..06127f5 100644
--- a/pages/SDL-Pango-Context.html-inc
+++ b/pages/SDL-Pango-Context.html-inc
@@ -30,7 +30,7 @@
 
 

new

-
 my $context = new SDL::Pango::Context;
+
 my $context = SDL::Pango::Context->new;
 
 

Creates a new SDL::Pango context object. See SDL::Pango.

diff --git a/pages/SDL-Pango.html-inc b/pages/SDL-Pango.html-inc index 5eb28b6..54b8861 100644 --- a/pages/SDL-Pango.html-inc +++ b/pages/SDL-Pango.html-inc @@ -53,7 +53,7 @@ SDL::Pango::init(); - my $context = new SDL::Pango::Context; + my $context = SDL::Pango::Context->new; SDL::Pango::set_default_color($context, 0xA7C344FF, 0); SDL::Pango::set_markup($context, 'Hallo <b>W<span foreground="red">o</span><i>r</i><u>l</u>d</b>!', -1); diff --git a/pages/SDL-SMPEG.html-inc b/pages/SDL-SMPEG.html-inc index ef4328e..084394a 100644 --- a/pages/SDL-SMPEG.html-inc +++ b/pages/SDL-SMPEG.html-inc @@ -25,7 +25,7 @@

SYNOPSIS

Top

-
  $video = new SDL::SMPEG ( -name => 'pr0n.mpg' );
+
  $video = SDL::SMPEG->new( -name => 'pr0n.mpg' );
 
 
diff --git a/pages/SDL-Sound.html-inc b/pages/SDL-Sound.html-inc index 2f8dd88..1886d9e 100644 --- a/pages/SDL-Sound.html-inc +++ b/pages/SDL-Sound.html-inc @@ -31,7 +31,7 @@

SDL::Sound is a module for loading WAV files for sound effects. The file can be loaded by creating a new SDL::Sound object by passing the filename to the constructor;

-
	my $sound = new SDL::Sound 'my_sfx.wav';
+
	my $sound = SDL::Sound->new( 'my_sfx.wav' );
 
 
diff --git a/pages/SDL-Surface.html-inc b/pages/SDL-Surface.html-inc index da88a7d..83709ba 100644 --- a/pages/SDL-Surface.html-inc +++ b/pages/SDL-Surface.html-inc @@ -24,7 +24,7 @@
  • Direct Write to Surface Pixel -
  • -

    get_pixels

    -
    -
     $surface->get_pixels( $offset )  
    +

    get_pixel

    +
    +
     my $pixel = $surface->get_pixel( $offset )  
     
     
    -

    Returns the current integer value at (surface->pixels)[offset]

    +

    Returns the pixel value for the given $offset. The pixel value depends on current pixel format.

    +

    Note: For surfaces with a palette (1 byte per pixel) the palette index is returned instead of color values.

    set_pixels

    @@ -192,20 +193,19 @@
     $surface->set_pixels( $offset, $value );
     
     
    -

    Sets the current integer to $value at (surface->pixels)[offset]

    +

    Sets the current pixel $value to the given $offset. The pixel value must fit the pixel format of the surface.

    +

    Note: For surfaces with a palette (1 byte per pixel) the palette index must be passed instead of color values.

    Usage

    -
      sub putpixel
    -  {
    -	my($x, $y, $color) = @_;
    -	my $lineoffset = $y * ($screen->pitch / $depth_in_bytes); 
    -	$screen->set_pixels( $lineoffset+ $x, $color);
    -  }
    +
     sub putpixel
    + {
    +     my($x, $y, $color) = @_;
    +     $screen->set_pixels( $x + $y * $screen->w, $color);
    + }
     
     
    -

    Note: $depth_in_bytes for 32 is 4, 16 is 2, 8 is 1;

    See also examples/sols/ch02.pl

    diff --git a/pages/documentation.html-inc b/pages/documentation.html-inc index ea2719a..74a94b0 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::Time- a 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::PDL

    Extension
    thumbSDL::App- a SDL perl 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
    Core
    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
    thumbSDL::Tutorial::Tetris- Let's Make Tetris

    UNCATEGORIZED
    thumbSDL::Credits
    thumbSDL::Game::Palette- a perl extension
    thumbSDL::MPEG- a SDL perl extension
    thumbSDL::Music- a perl extension
    thumbSDL::OpenGL- a perl extension
    thumbSDL::SMPEG- a SDL perl extension
    thumbSDL::Sound- a perl extension
    thumbSDL::Tool::Font- a perl extension
    thumbSDL::Tool::Graphic
    +

    Documentation (latest development branch)

    Core
    thumbSDL- Simple DirectMedia Layer for Perl
    thumbSDL::Time- a 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::PDL

    Extension
    thumbSDL::App- a SDL perl 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
    Core
    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
    thumbSDL::Credits- Authors and contributors of the SDL Perl project
    thumbSDL::Game::Palette- a perl extension
    thumbSDL::MPEG- a SDL perl extension
    thumbSDL::Music- a perl extension
    thumbSDL::OpenGL- a perl extension
    thumbSDL::SMPEG- a SDL perl extension
    thumbSDL::Sound- a perl extension
    thumbSDL::Tool::Font- a perl extension
    thumbSDL::Tool::Graphic
    diff --git a/tools/PM-Pod2html-snippet.pl b/tools/PM-Pod2html-snippet.pl index d45d28d..34dd814 100644 --- a/tools/PM-Pod2html-snippet.pl +++ b/tools/PM-Pod2html-snippet.pl @@ -7,7 +7,7 @@ use Pod::Xhtml; use File::Copy; use File::Spec::Functions qw(rel2abs splitpath splitdir catpath catdir catfile canonpath); -my $input_path = 'C:/SDL_perl/lib/pods'; +my $input_path = 'D:/dev/SDL_perl/lib/pods'; $input_path = $ARGV[0] if $ARGV[0]; my ($volume, $dirs) = splitpath(rel2abs(__FILE__));