From: kthakore Date: Wed, 27 Oct 2010 05:26:08 +0000 (-0400) Subject: Merge branch 'master' of git.shadowcat.co.uk:SDL-Site X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=sdlgit%2FSDL-Site.git;a=commitdiff_plain;h=bd9f3e156952798c46df29d610af0a36ea065e89;hp=3ca0acf80ad36dcad7c27c606985e2c5d838040b Merge branch 'master' of git.shadowcat.co.uk:SDL-Site --- diff --git a/pages/SDL-Audio.html-inc b/pages/SDL-Audio.html-inc index b8c5b8f..236d59a 100644 --- a/pages/SDL-Audio.html-inc +++ b/pages/SDL-Audio.html-inc @@ -329,7 +329,7 @@ function is not running. Do not call this from the callback function or you will

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-AudioCVT.html-inc b/pages/SDL-AudioCVT.html-inc index df23396..76fa35c 100644 --- a/pages/SDL-AudioCVT.html-inc +++ b/pages/SDL-AudioCVT.html-inc @@ -110,7 +110,7 @@ see SDL::AudioSpec.

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-AudioSpec.html-inc b/pages/SDL-AudioSpec.html-inc index 89ddad0..0442183 100644 --- a/pages/SDL-AudioSpec.html-inc +++ b/pages/SDL-AudioSpec.html-inc @@ -127,7 +127,7 @@ set to 4096.

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

diff --git a/pages/SDL-CD.html-inc b/pages/SDL-CD.html-inc index b44c285..1bacb95 100644 --- a/pages/SDL-CD.html-inc +++ b/pages/SDL-CD.html-inc @@ -126,7 +126,7 @@

Plays the given SDL::CD starting at track $start_track, for $ntracks tracks.

$start_frame is the frame offset, from the beginning of the $start_track, at which to start. $nframes is the frame offset, from the beginning of the last track ($start_track+$ntracks), at which to end playing.

-

play_tracks() should only be called after calling status to get information about the CD.

+

play_tracks() should only be called after calling http://search.cpan.org/perldoc? to get information about the CD.

Note: Data tracks are ignored.

Returns 0, or -1 if there was an error.

@@ -229,7 +229,7 @@ beginning of the last track ($start_track+$ntracks), at which to end playing.

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-CDROM.html-inc b/pages/SDL-CDROM.html-inc index 5e4527d..13e60ee 100644 --- a/pages/SDL-CDROM.html-inc +++ b/pages/SDL-CDROM.html-inc @@ -76,7 +76,7 @@

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-CDTrack.html-inc b/pages/SDL-CDTrack.html-inc index 87cd3ec..29d4e4e 100644 --- a/pages/SDL-CDTrack.html-inc +++ b/pages/SDL-CDTrack.html-inc @@ -117,7 +117,7 @@

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-Color.html-inc b/pages/SDL-Color.html-inc index 16932ed..115ec4f 100644 --- a/pages/SDL-Color.html-inc +++ b/pages/SDL-Color.html-inc @@ -99,7 +99,7 @@ if not, it returns the blue component of the color.

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

diff --git a/pages/SDL-Cookbook-OpenGL.html-inc b/pages/SDL-Cookbook-OpenGL.html-inc index a0794df..8bc33d9 100644 --- a/pages/SDL-Cookbook-OpenGL.html-inc +++ b/pages/SDL-Cookbook-OpenGL.html-inc @@ -149,12 +149,12 @@

SEE ALSO

Top

-

perl SDLx::App OpenGL

+

perl SDLx::App OpenGL

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

diff --git a/pages/SDL-Cookbook-PDL.html-inc b/pages/SDL-Cookbook-PDL.html-inc index 2436684..9e46309 100644 --- a/pages/SDL-Cookbook-PDL.html-inc +++ b/pages/SDL-Cookbook-PDL.html-inc @@ -110,7 +110,7 @@ After that a simple update_rect will so your new surface on the screen.

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

diff --git a/pages/SDL-Cookbook.html-inc b/pages/SDL-Cookbook.html-inc index a4896cd..28cf9a3 100644 --- a/pages/SDL-Cookbook.html-inc +++ b/pages/SDL-Cookbook.html-inc @@ -42,7 +42,7 @@

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-Cursor.html-inc b/pages/SDL-Cursor.html-inc index ff7314f..5a7df01 100644 --- a/pages/SDL-Cursor.html-inc +++ b/pages/SDL-Cursor.html-inc @@ -132,7 +132,7 @@ For example, if you wanted a 9 pixel crosshair you might do the following:

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

diff --git a/pages/SDL-Deprecated.html-inc b/pages/SDL-Deprecated.html-inc index 6d865cf..563385e 100644 --- a/pages/SDL-Deprecated.html-inc +++ b/pages/SDL-Deprecated.html-inc @@ -54,11 +54,11 @@ The second argument to move handlers, the t value, is now the third
SDLx::App
-

Now depends on SDLx::Surface. To get the SDL::Surface, use -surface() >. Alternatively SDLx::Surface::display() (display in SDLx::Surface).

+

Now depends on SDLx::Surface. To get the SDL::Surface, use -surface() >. Alternatively SDLx::Surface::display().

SDLx::Surface
-

get_display is now called SDLx::Surface::display (display in SDLx::Surface).

+

get_display is now called SDLx::Surface::display.

SDLx::Sprite::Animated
@@ -83,7 +83,7 @@ The second argument to move handlers, the t value, is now the third

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-Event.html-inc b/pages/SDL-Event.html-inc index 24c7ecd..542b7b0 100644 --- a/pages/SDL-Event.html-inc +++ b/pages/SDL-Event.html-inc @@ -165,22 +165,22 @@ which union member relates to which event type.

Available type constants:

Event types are grouped by masks. SDL_EVENTMASK($type) will return the proper mask for the given type.

@@ -263,7 +263,7 @@ and when a key is pressed (type=SDL_KEYDOWN or key_state=SDL_ then an SDL_RELEASED when released and pressed again. For these keys KEYUP and KEYDOWN events are therefore analogous to the state of the caps lock and num lock LEDs rather than the keys themselves. These special cases are required for compatibility with Sun workstations.

-

Note: Repeating SDL_KEYDOWN events will occur if key repeat is enabled (see SDL_EnableKeyRepeat).

+

Note: Repeating SDL_KEYDOWN events will occur if key repeat is enabled (see SDL::Events::enable_key_repeat).

key_state

@@ -303,7 +303,7 @@ This field is very useful when you are checking for certain key presses, like so

key_unicode

-

The unicode field is only used when UNICODE translation is enabled with SDL_EnableUNICODE. +

The unicode field is only used when UNICODE translation is enabled with SDL::Events::enable_unicode. If unicode is non-zero then this is the UNICODE character corresponding to the keypress. If the high 9 bits of the character are 0, then this maps to the equivalent ASCII character:

 my $char;
@@ -332,7 +332,7 @@ button states (motion_state).

motion_state

-

The button state can be interpreted using the SDL_BUTTON macro (see SDL_GetMouseState).

+

The button state can be interpreted using the SDL_BUTTON macro (see SDL::Events::get_mouse_state).

motion_x, motion_y

@@ -350,9 +350,9 @@ This is currently only implemented on Windows and Linux/Unix-alikes.

Mouse button events

-

When a mouse button press or release is detected the number of the button pressed (from 1 to 255, -with 1 usually being the left button and 2 the right) is placed into button_button, the position of the mouse -when this event occured is stored in the button_x and the button_y fields. Like SDL_KeyboardEvent, +

When a mouse button press or release is detected, the number of the button pressed (from 1 to 255, +with 1 usually being the left button and 2 the right) is placed into button_button. The position of the mouse +when this event occured is stored in the button_x and the button_y fields. Like a keyboard event, information on whether the event was a press or a release event is stored in both the button_type and button_state fields, but this should be obvious.

Mouse wheel events are reported as buttons 4 (up) and 5 (down). Two events are generated i.e. you get @@ -525,8 +525,8 @@ the event queue using SDL::Events::push_event. The contents of the programmer, the only requirement is that type is a value from SDL_USEREVENT to SDL_NUMEVENTS-1 (inclusive)

 my $event = SDL::Event->new();
     $event->type ( SDL_USEREVENT + 3 );
-    $event->event_code(10);
-    $event->data1('hello event');
+    $event->user_code(10);
+    $event->user_data1('hello event');
 
  SDL::Events::push_event($event);
 
@@ -554,7 +554,7 @@ screen updates will still report success even though the application will no lon
 

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

SEE ALSO

Top

diff --git a/pages/SDL-Events.html-inc b/pages/SDL-Events.html-inc index dcfc02a..d23fb17 100644 --- a/pages/SDL-Events.html-inc +++ b/pages/SDL-Events.html-inc @@ -79,15 +79,15 @@ my $event = SDL::Event->new(); # notices 'Event' ne 'Events' while( 1 ) - { - SDL::Events::pump_events(); - while( SDL::Events::poll_event($event) ) - { - #check by event type - on_active() if $event->type == SDL_ACTIVEEVENT; - ... - } - } + { + SDL::Events::pump_events(); + while( SDL::Events::poll_event($event) ) + { + #check by event type + on_active() if $event->type == SDL_ACTIVEEVENT; + ... + } + } @@ -269,8 +269,9 @@
	pump_events();
 
 
-

pump_events gathers all the pending input information from devices and places it on the event queue. Without calls to pump_events no events would ever be placed on the queue. -Often the need for calls to pump_events is hidden from the user since poll_event and wait_event implicitly call pump_events. +

pump_events gathers all the pending input information from devices and places it on the event queue. Without calls to pump_events no events would +ever be placed on the queue. +Often the need for calls to pump_events is hidden from the user since http://search.cpan.org/perldoc? and http://search.cpan.org/perldoc? implicitly call pump_events. However, if you are not polling or waiting for events (e.g. you are filtering them), then you must call pump_events to force an event queue update.

@@ -285,8 +286,10 @@ However, if you are not polling or waiting for events (e.g. you are filtering th

If action is SDL_ADDEVENT, up to numevents events will be added to the back of the event queue.

-

If action is SDL_PEEKEVENT, up to numevents events at the front of the event queue, matching mask, will be returned and will not be removed from the queue.

-

If action is SDL_GETEVENT, up to numevents events at the front of the event queue, matching mask, will be returned and will be removed from the queue.

+

If action is SDL_PEEKEVENT, up to numevents events at the front of the event queue, matching mask, will be returned and will not be removed from +the queue.

+

If action is SDL_GETEVENT, up to numevents events at the front of the event queue, matching mask, will be returned and will be removed from the +queue.

The mask parameter is a bitwise OR of SDL::Events::SDL_EVENTMASK(event_type), for all event types you are interested in

This function is thread-safe.

You may have to call pump_events before calling this function. Otherwise, the events may not be ready to be filtered when you call peep_events.

@@ -309,7 +312,8 @@ However, if you are not polling or waiting for events (e.g. you are filtering th

Polls for currently pending events.

If $event is not NULL, the next event is removed from the queue and stored in the SDL::Event structure pointed to by $event.

-

As this function implicitly calls pump_events, you can only call this function in the thread that set the video mode with SDL::Video::set_video_mode.

+

As this function implicitly calls pump_events, you can only call this function in the thread that set the video mode with +SDL::Video::set_video_mode.

RETURN

@@ -320,7 +324,8 @@ However, if you are not polling or waiting for events (e.g. you are filtering th

push_event($event)

Pushes an event onto the event queue

-

The event queue can actually be used as a two way communication channel. Not only can events be read from the queue, but the user can also push their own events onto it. event is a pointer to the event structure you wish to push onto the queue. +

The event queue can actually be used as a two way communication channel. Not only can events be read from the queue, but the user can also push +their own events onto it. event is a pointer to the event structure you wish to push onto the queue. The event is copied into the queue, and the caller may dispose of the memory pointed to after push_event returns.

Note: Pushing device input events onto the queue doesn't modify the state of the device within SDL.

This function is thread safe, and can be called from other threads safely.

@@ -335,7 +340,8 @@ The event is copied into the queue, and the caller may dispose of the memory poi

Waits indefinitely for the next available $event, returning 0 if there was an error while waiting for events, 1 otherwise.

If $event is not NULL, the next event is removed from the queue and stored in $event.

-

As this function implicitly calls SDL_PumpEvents, you can only call this function in the thread that SDL::Video::set_video_mode.

+

As this function implicitly calls SDL_PumpEvents, you can only call this function in the thread that +SDL::Video::set_video_mode.

RETURN

@@ -360,8 +366,10 @@ The event is copied into the queue, and the caller may dispose of the memory poi

to filter the event return a 0, to pass the filter return a 1.

-

One Caveat is if you are filtering SDL_QUIT the event will be filtered if it is non-intterupt call ( Window closes normally ). If it is a interrupt SDL_QUIT it will be process on the next event poll.

-

Events pushed onto to the queue with SDL::Events::push_events or SDL::Events::peep_events do not get filtered.

+

One Caveat is if you are filtering SDL_QUIT the event will be filtered if it is non-intterupt call ( Window closes normally ). If it is a +interrupt SDL_QUIT it will be process on the next event poll.

+

Events pushed onto to the queue with SDL::Events::push_events or SDL::Events::peep_events +do not get filtered.

This callback may run in a different thread.

@@ -374,7 +382,8 @@ The event is copied into the queue, and the caller may dispose of the memory poi

Use SDL::Events::pump_events to update the state array.

-

This function gives you the current state after all events have been processed, so if a key or button has been pressed and released before you process events, then the pressed state will never show up in the get_key_state call.

+

This function gives you the current state after all events have been processed, so if a key or button has been pressed and released before you +process events, then the pressed state will never show up in the get_key_state call.

This function doesn't take into account whether shift has been pressed or not.

@@ -495,7 +504,10 @@ The event is copied into the queue, and the caller may dispose of the memory poi $previous_translation_mode = SDL::Events::enable_unicode( 0 ); #disables -

To obtain the character codes corresponding to received keyboard events, Unicode translation must first be turned on using this function. The translation incurs a slight overhead for each keyboard event and is therefore disabled by default. For each subsequently recieved key down event, the unicode member of the SDL::Event::key_sym provided structure will be then contain the corresponding character code, or otherwise zero.

+

To obtain the character codes corresponding to received keyboard events, Unicode translation must first be turned on using this function. The +translation incurs a slight overhead for each keyboard event and is therefore disabled by default. For each subsequently recieved key down event, +the unicode member of the SDL::Event::key_sym provided structure will be then contain the corresponding character code, or +otherwise zero.

A value of 1 for enabling, 0 for disabling and -1 for unchanged. -1 is usefull for querying the current translation mode.

Only key press events will be translated not release events.

Returns the previous translation mode as (1,0).

@@ -507,7 +519,8 @@ The event is copied into the queue, and the caller may dispose of the memory poi
 my $success = SDL::Events::enable_key_repeat( $delay, $interval );
 
 
-

Enables or disables the keyboard repeat rate. $delay specifies how long the key must be pressed before it begins repeating, it then repleats at the speed specified by $interval. Both $delay and $interval are expressed in milliseconds.

+

Enables or disables the keyboard repeat rate. $delay specifies how long the key must be pressed before it begins repeating, it then repleats at the +speed specified by $interval. Both $delay and $interval are expressed in milliseconds.

Setting $delay to 0 disables key repeating completely. Good default values are SDL_DEFAULT_REPEAT_DELAY and SDL_DEFAULT_REPEAT_INTERVAL.

Return 0 on success and -1 on fail.

@@ -515,15 +528,15 @@ The event is copied into the queue, and the caller may dispose of the memory poi

get_mouse_state

Retrives the current state of the mouse

-
	my ($mask,$x,$y) = @{ SDL::Events::get_mouse_state( ) };
+
  my ($mask,$x,$y) = @{ SDL::Events::get_mouse_state( ) };
 
-        print 'Button Left pressed' if ($mask & SDL_BUTTON_LMASK);    
+  print 'Button Left pressed' if ($mask & SDL_BUTTON_LMASK);    
 
-        print 'Button Right pressed' if ($mask & SDL_BUTTON_RMASK);   
+  print 'Button Right pressed' if ($mask & SDL_BUTTON_RMASK);   
 
-        print 'Button Middle pressed' if ($mask & SDL_BUTTON_MMASK);  
+  print 'Button Middle pressed' if ($mask & SDL_BUTTON_MMASK);  
 
-        print $x.','.$y;
+  print $x.','.$y;
 
 

The current button state is returned as a button $bitmask, which can be tested using the the above constants

@@ -532,15 +545,15 @@ The event is copied into the queue, and the caller may dispose of the memory poi

get_relative_mouse_state

Retrives the current relative state of the mouse

-
	my ($mask,$x,$y) = @{ SDL::Events::get_mouse_state( ) };
+
  my ($mask,$x,$y) = @{ SDL::Events::get_mouse_state( ) };
 
-        print 'Button Left pressed' if ($mask & SDL_BUTTON_LMASK);    
+  print 'Button Left pressed' if ($mask & SDL_BUTTON_LMASK);    
 
-        print 'Button Right pressed' if ($mask & SDL_BUTTON_RMASK);   
+  print 'Button Right pressed' if ($mask & SDL_BUTTON_RMASK);   
 
-        print 'Button Middle pressed' if ($mask & SDL_BUTTON_MMASK);  
+  print 'Button Middle pressed' if ($mask & SDL_BUTTON_MMASK);  
 
-        print $x.','.$y; # this is relative to the last postion of the mouse
+  print $x.','.$y; # this is relative to the last postion of the mouse
 
 

The current button state is returned as a button $bitmask, which can be tested using the the above constants

@@ -591,7 +604,8 @@ The event is copied into the queue, and the caller may dispose of the memory poi
	my $status = SDL::Events::joystick_event_state( $state );
 
 
-

This function is used to enable or disable joystick event processing. With joystick event processing disabled you will have to update joystick states with SDL_JoystickUpdate and read the joystick information manually. $state can be:

+

This function is used to enable or disable joystick event processing. With joystick event processing disabled you will have to update joystick +states with SDL::Joystick::update and read the joystick information manually. $state can be:

SDL_QUERY
SDL_ENABLE
@@ -611,7 +625,7 @@ The event is copied into the queue, and the caller may dispose of the memory poi

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-GFX-BlitFunc.html-inc b/pages/SDL-GFX-BlitFunc.html-inc index fe5e2fd..72c97be 100644 --- a/pages/SDL-GFX-BlitFunc.html-inc +++ b/pages/SDL-GFX-BlitFunc.html-inc @@ -26,7 +26,7 @@

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-GFX-FPSManager.html-inc b/pages/SDL-GFX-FPSManager.html-inc index 2d38964..80221dc 100644 --- a/pages/SDL-GFX-FPSManager.html-inc +++ b/pages/SDL-GFX-FPSManager.html-inc @@ -77,7 +77,7 @@

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-GFX-Framerate.html-inc b/pages/SDL-GFX-Framerate.html-inc index 4bbf62f..a759250 100644 --- a/pages/SDL-GFX-Framerate.html-inc +++ b/pages/SDL-GFX-Framerate.html-inc @@ -77,7 +77,7 @@ If the computer cannot keep up with the rate (i.e.drawing too slow), the delay i

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-GFX-ImageFilter.html-inc b/pages/SDL-GFX-ImageFilter.html-inc index d8ae3b1..4228287 100644 --- a/pages/SDL-GFX-ImageFilter.html-inc +++ b/pages/SDL-GFX-ImageFilter.html-inc @@ -653,7 +653,7 @@ gfx_image_restore_stack()

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-GFX-Primitives.html-inc b/pages/SDL-GFX-Primitives.html-inc index 85f3ed1..2371174 100644 --- a/pages/SDL-GFX-Primitives.html-inc +++ b/pages/SDL-GFX-Primitives.html-inc @@ -55,7 +55,7 @@

DESCRIPTION

Top

All functions take an SDL::Surface object as first parameter. This can be a new surface that will be blittet afterwads, can be an surface -obtained by SDL::Video::set_video_mode or can be an SDLx::App.

+obtained by SDL::Video::set_video_mode or can be an SDLx::App.

The color values for the _color functions are 0xRRGGBBAA (32bit), even if the surface uses e. g. 8bit colors.

@@ -338,7 +338,7 @@ obtained by SDL::Video::set_video_mode<

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-GFX-Rotozoom.html-inc b/pages/SDL-GFX-Rotozoom.html-inc index 50d9c4d..f60c4ee 100644 --- a/pages/SDL-GFX-Rotozoom.html-inc +++ b/pages/SDL-GFX-Rotozoom.html-inc @@ -192,7 +192,7 @@

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

diff --git a/pages/SDL-Image.html-inc b/pages/SDL-Image.html-inc index 6190dcd..5fb86b5 100644 --- a/pages/SDL-Image.html-inc +++ b/pages/SDL-Image.html-inc @@ -101,7 +101,8 @@ This is NOT the same as XBM(X11 Bitmap) format, which is for monocolor images. <
XCF

GIMP native (.xcf) (XCF = eXperimental Computing Facility?) -This format is always changing, and since there's no library supplied by the GIMP project to load XCF, the loader may frequently fail to load much of any image from an XCF file. It's better to load this in GIMP and convert to a better supported image format.

+This format is always changing, and since there's no library supplied by the GIMP project to load XCF, the loader may frequently fail to load much +of any image from an XCF file. It's better to load this in GIMP and convert to a better supported image format.

PCX
@@ -121,8 +122,7 @@ This format is always changing, and since there's no library supplied by the GIM
LBM
-

Interleaved Bitmap (.lbm or .iff) FORM : ILBM or PBM(packed bitmap) -HAM6, HAM8, and 24bit types are not supported.

+

Interleaved Bitmap (.lbm or .iff) FORM : ILBM or PBM(packed bitmap), HAM6, HAM8, and 24bit types are not supported.

PNG
@@ -148,10 +148,15 @@ HAM6, HAM8, and 24bit types are not supported.

$file Image file name to load a surface from.

-

Load file for use as an image in a new SDL::Surface. This actually calls IMG_LoadTyped_RW the binded function to SDL::Image::load_typed_rw, with the file extension used as the type string. This can load all supported image files, including TGA as long as the filename ends with ".tga". It is best to call this outside of event loops, and rather keep the loaded images around until you are really done with them, as disk speed and image conversion to a surface is not that speedy. -Note: If the image format loader requires initialization, it will attempt to do that the first time it is needed if you have not already called SDL::Image::init to load support for your image format. -Note: If the image format supports a transparent pixel, SDL::Image will set the colorkey for the surface. You can enable RLE acceleration on the surface afterwards by calling: -SDL::Video::set_color_key

+

Load file for use as an image in a new SDL::Surface. This actually calls SDL::Image::load_typed_rw, with the +file extension used as the type string. This can load all supported image files, including TGA as long as the filename ends with ".tga". It is +best to call this outside of event loops, and rather keep the loaded images around until you are really done with them, as disk speed and image +conversion to a surface is not that speedy.

+

Note: If the image format loader requires initialization, it will attempt to do that the first time it is needed if you have not already called +SDL::Image::init to load support for your image format.

+

Note: If the image format supports a transparent pixel, SDL::Image will set the colorkey for the surface. You can enable RLE acceleration on +the surface afterwards by calling:

+

SDL::Video::set_color_key

  my $image = SDL::Image::load( $some_png_file );
   SDL::Video::set_color_key($image, SDL_RLEACCEL, $image->format->colorkey);
 
@@ -160,7 +165,8 @@ Note: If the image format supports a transparent pixel, 
 

Return

-

An image as a SDL::Surface. NULL is returned on errors, such as no support built for the image, or a file reading error. Use SDL::get_error to get cause of error.

+

An image as a SDL::Surface. NULL is returned on errors, such as no support built for the image, or a file reading error. Use +SDL::get_error to get cause of error.

load_typed_rw

@@ -175,7 +181,8 @@ Note: If the image format supports a transparent pixel,
freesrc
-

A non-zero value mean is will automatically close/free the src for you. Since SDL Perl cannot handle the memory inside this function you would most likely want 1 here.

+

A non-zero value mean is will automatically close/free the src for you. Since SDL Perl cannot handle the memory inside this function you would most +likely want 1 here.

type
@@ -201,10 +208,13 @@ Note: If the image format supports a transparent pixel,
-

Load src for use as a surface. This can load all supported image formats. This method does not guarantee that the format specified by type is the format of the loaded image, except in the case when TGA format is specified (or any other non-magicable format in the future). Using SDL_RWops is not covered here, but they enable you to load from almost any source. -Note: If the image format loader requires initialization, it will attempt to do that the first time it is needed if you have not already called SDL::Image::init to load support for your image format. -Note: If the image format supports a transparent pixel, SDL::Image will set the colorkey for the surface. You can enable RLE acceleration on the surface afterwards by calling: -SDL::Video::set_color_key

+

Load src for use as a surface. This can load all supported image formats. This method does not guarantee that the format specified by type is the +format of the loaded image, except in the case when TGA format is specified (or any other non-magicable format in the future). Using SDL_RWops is +not covered here, but they enable you to load from almost any source.

+

Note: If the image format loader requires initialization, it will attempt to do that the first time it is needed if you have not already called +SDL::Image::init to load support for your image format.

+

Note: If the image format supports a transparent pixel, SDL::Image will set the colorkey for the surface. You can enable RLE acceleration on +the surface afterwards by calling: SDL::Video::set_color_key

Transparency

@@ -402,10 +412,13 @@ Note: If the image format supports a transparent pixel, IMG_INIT_PNG
IMG_INIT_TIF
-

Initialize by loading support as indicated by the flags, or at least return success if support is already loaded. You may call this multiple times, which will actually require you to call IMG_Quit just once to clean up. You may call this function with a 0 to retrieve whether support was built-in or not loaded yet. -Note: to load JPG, PNG, and/or TIF images you can call IMG_Init with the right IMG_INIT_* flags OR'd together before you program gets busy, to prevent a later hiccup while it loads the library, and to check that you do have the support that you need before you try and use it. -Note: No initialization is needed nor performed when using the SDL::Image::is_JPG, SDL::Image::is_PNG, and SDL::Image::is_TIF functions. -Note: this function does not always set the error string, so do not depend on SDL::Image::get_error being meaningful all the time.

+

Initialize by loading support as indicated by the flags, or at least return success if support is already loaded. You may call this multiple times, +which will actually require you to call IMG_Quit just once to clean up. You may call this function with a 0 to retrieve whether support was built-in +or not loaded yet.

+

Note: to load JPG, PNG, and/or TIF images you can call IMG_Init with the right IMG_INIT_* flags OR'd together before you program gets busy, to +prevent a later hiccup while it loads the library, and to check that you do have the support that you need before you try and use it.

+

Note: No initialization is needed nor performed when using the SDL::Image::is_JPG, SDL::Image::is_PNG, and SDL::Image::is_TIF functions.

+

Note: this function does not always set the error string, so do not depend on SDL::Image::get_error being meaningful all the time.

Return

@@ -425,7 +438,10 @@ Note: this function does not always set the error string, so do not depend on SD

quit

For version SDL_image 1.2.10 and up

-

This function cleans up all dynamically loaded library handles, freeing memory. If support is required again it will be initialized again, either by SDL::Image::init or loading an image with dynamic support required. You may call this function when SDL::Image::load functions are no longer needed for the JPG, PNG, and TIF image formats. You only need to call this function once, no matter how many times SDL::Image::init was called.

+

This function cleans up all dynamically loaded library handles, freeing memory. If support is required again it will be initialized again, either +by SDL::Image::init or loading an image with dynamic support required. You may call this function when +SDL::Image::load functions are no longer needed for the JPG, PNG, and TIF image formats. You only need to call this function +once, no matter how many times SDL::Image::init was called.

Example

@@ -455,7 +471,7 @@ Note: this function does not always set the error string, so do not depend on SD

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-Joystick.html-inc b/pages/SDL-Joystick.html-inc index 14dd677..6c4979c 100644 --- a/pages/SDL-Joystick.html-inc +++ b/pages/SDL-Joystick.html-inc @@ -274,7 +274,7 @@ it may be necessary to impose certain tolerances on these values to account for

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-Mixer-Channels.html-inc b/pages/SDL-Mixer-Channels.html-inc index 852f8cf..c68613b 100644 --- a/pages/SDL-Mixer-Channels.html-inc +++ b/pages/SDL-Mixer-Channels.html-inc @@ -235,7 +235,7 @@ the audio callback, or SDL_mixer will explicitly lock the audio before calling y

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-Mixer-Effects.html-inc b/pages/SDL-Mixer-Effects.html-inc index ba2e9c2..fb61d50 100644 --- a/pages/SDL-Mixer-Effects.html-inc +++ b/pages/SDL-Mixer-Effects.html-inc @@ -132,7 +132,8 @@ functions called, if they were specified in SDL::Mixer::Effects::register with MIX_CHANNEL_POST to use multiple postmix processors. +There can only be one postmix function used at a time through this method. Use SDL::Mixer::Effects::register +with MIX_CHANNEL_POST to use multiple postmix processors. This postmix processor is run AFTER all the registered postmixers set up by SDL::Mixer::Effects::register.

Note: Do not use this on a threaded perl. This will crash.

@@ -179,7 +180,7 @@ angle and distance from the camera's point of view, the effect pans and attenuat

$distance is 0(close/loud) to 255(far/quiet).

Note: Using angle and distance of 0, will cause the effect to unregister itself from channel. You cannot unregister it any other way, unless you use SDL::Mixer::Effects::unregister_all on the channel.

-

Returns: Zero on errors, such as an invalid channel, or if SDL::Mixer::Effects::register failed.

+

Returns: Zero on errors, such as an invalid channel, or if SDL::Mixer::Effects::register failed.

set_reverse_stereo

@@ -194,7 +195,7 @@ unless you use SDL::Mixer::Effe

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-Mixer-Groups.html-inc b/pages/SDL-Mixer-Groups.html-inc index f35aaf9..961490f 100644 --- a/pages/SDL-Mixer-Groups.html-inc +++ b/pages/SDL-Mixer-Groups.html-inc @@ -126,7 +126,7 @@ previously allocated (see S

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-Mixer-MixChunk.html-inc b/pages/SDL-Mixer-MixChunk.html-inc index 4e34915..7beec47 100644 --- a/pages/SDL-Mixer-MixChunk.html-inc +++ b/pages/SDL-Mixer-MixChunk.html-inc @@ -61,7 +61,7 @@

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-Mixer-MixMusic.html-inc b/pages/SDL-Mixer-MixMusic.html-inc index 1fe1b44..0b61425 100644 --- a/pages/SDL-Mixer-MixMusic.html-inc +++ b/pages/SDL-Mixer-MixMusic.html-inc @@ -27,7 +27,7 @@

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-Mixer-Music.html-inc b/pages/SDL-Mixer-Music.html-inc index 4fa2a72..0251a67 100644 --- a/pages/SDL-Mixer-Music.html-inc +++ b/pages/SDL-Mixer-Music.html-inc @@ -47,7 +47,7 @@
 my $music = SDL::Mixer::Music::load_MUS( $file );
 
 
-

load_MUS loads a music file into a SDL::Mixer::MixMusic structure. This can be passed to SDL::Mixer::Music::play_music.

+

load_MUS loads a music file into a SDL::Mixer::MixMusic structure. This can be passed to play_music.

hook_music

@@ -91,7 +91,8 @@ Using a custom music player and the internal music player is not possible, the c
 SDL::Mixer::Music::hook_music_finished( 'main::callback' );
 
 
-

This callback is called when music called by e.g. SDL::Mixer::Music::play_music or SDL::Mixer::Music::fade_in_music stops naturally. +

This callback is called when music called by e.g. SDL::Mixer::Music::play_music or +SDL::Mixer::Music::fade_in_music stops naturally. This happens when the music is over or is fading out.

Note: If you play music via SDL::Mixer::Music::hook_music, this callback will never be called.

Example:

@@ -267,7 +268,7 @@ Does not go in reverse... negative values do nothing.

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-Mixer-Samples.html-inc b/pages/SDL-Mixer-Samples.html-inc index 673288a..8dca92b 100644 --- a/pages/SDL-Mixer-Samples.html-inc +++ b/pages/SDL-Mixer-Samples.html-inc @@ -54,7 +54,7 @@
 my $mix_chunk = SDL::Mixer::Samples::load_WAV( $file );
 
 
-

load_WAV reads a file and passes it to SDL::Mixer::Samples::load_WAV_RW. SO this is a quick way to load a file into a chunk.

+

load_WAV reads a file and passes it to SDL::Mixer::Samples::load_WAV_RW. SO this is a quick way to load a file into a chunk.

Example:

 my $chunk = SDL::Mixer::Samples::load_WAV('sample.wav');
 
@@ -112,7 +112,7 @@ free the source memory after loading is complete or not.

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-Mixer.html-inc b/pages/SDL-Mixer.html-inc index 43e150a..4c04743 100644 --- a/pages/SDL-Mixer.html-inc +++ b/pages/SDL-Mixer.html-inc @@ -221,7 +221,7 @@ This function returns 1 as first array element (status) if the audio has been op

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-Mouse.html-inc b/pages/SDL-Mouse.html-inc index b0d79eb..537d9df 100644 --- a/pages/SDL-Mouse.html-inc +++ b/pages/SDL-Mouse.html-inc @@ -105,7 +105,7 @@ The current state of the mouse cursor can be queried by passing SDL_QUERY<

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-MultiThread.html-inc b/pages/SDL-MultiThread.html-inc index bf5aac7..cf3fa23 100644 --- a/pages/SDL-MultiThread.html-inc +++ b/pages/SDL-MultiThread.html-inc @@ -29,7 +29,7 @@

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-Overlay.html-inc b/pages/SDL-Overlay.html-inc index 4d4f2f5..199a256 100644 --- a/pages/SDL-Overlay.html-inc +++ b/pages/SDL-Overlay.html-inc @@ -122,7 +122,7 @@ SDL_YVYU_OVERLAY 0x55595659 /* Packed mode: Y0+V0+Y1+U0 */

As of release 2.3 direct right to overlay is disable.

An array of pointers to the data of each plane. The overlay should be locked before these pointers are used.

-

see SDL::Video::lock_YUV_overlay, SDL::Video::unload_YUV_overlay

+

see SDL::Video::lock_YUV_overlay, SDL::Video::unload_YUV_overlay

hw_overlay

@@ -132,7 +132,7 @@ SDL_YVYU_OVERLAY 0x55595659 /* Packed mode: Y0+V0+Y1+U0 */

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-Palette.html-inc b/pages/SDL-Palette.html-inc index f0fc7c9..c759271 100644 --- a/pages/SDL-Palette.html-inc +++ b/pages/SDL-Palette.html-inc @@ -60,7 +60,7 @@ values of a SDL::Surface's palette can be set with the SDL::V

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-Pango-Context.html-inc b/pages/SDL-Pango-Context.html-inc index db375a4..7167d04 100644 --- a/pages/SDL-Pango-Context.html-inc +++ b/pages/SDL-Pango-Context.html-inc @@ -38,7 +38,7 @@

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

SEE ALSO

Top

diff --git a/pages/SDL-Pango.html-inc b/pages/SDL-Pango.html-inc index 0aaf1be..27c99eb 100644 --- a/pages/SDL-Pango.html-inc +++ b/pages/SDL-Pango.html-inc @@ -213,7 +213,7 @@ background.

Sets the direction of the text to either left-to-right or right-to-left.

-

See CONSTANTS.

+

See http://search.cpan.org/perldoc?.

set_dpi

@@ -275,7 +275,7 @@ background.

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

SEE ALSO

Top

diff --git a/pages/SDL-PixelFormat.html-inc b/pages/SDL-PixelFormat.html-inc index 55cfb88..5be459b 100644 --- a/pages/SDL-PixelFormat.html-inc +++ b/pages/SDL-PixelFormat.html-inc @@ -148,7 +148,7 @@

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-RWOps.html-inc b/pages/SDL-RWOps.html-inc index 8c9447e..2ee714c 100644 --- a/pages/SDL-RWOps.html-inc +++ b/pages/SDL-RWOps.html-inc @@ -204,7 +204,7 @@ Returns 0 on success, -1 on error.

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

diff --git a/pages/SDL-Rect.html-inc b/pages/SDL-Rect.html-inc index 1a98ec3..ee94032 100644 --- a/pages/SDL-Rect.html-inc +++ b/pages/SDL-Rect.html-inc @@ -110,7 +110,7 @@ if not, it returns the h component of the rectangle.

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-Surface.html-inc b/pages/SDL-Surface.html-inc index 8cd7397..d0e3973 100644 --- a/pages/SDL-Surface.html-inc +++ b/pages/SDL-Surface.html-inc @@ -189,7 +189,7 @@ The pixel value must fit the pixel format of the surface.

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-TTF-Font.html-inc b/pages/SDL-TTF-Font.html-inc index c36da90..38815eb 100644 --- a/pages/SDL-TTF-Font.html-inc +++ b/pages/SDL-TTF-Font.html-inc @@ -46,7 +46,7 @@ You can specify the face index of a font file containing multiple faces.

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

SEE ALSO

Top

diff --git a/pages/SDL-TTF.html-inc b/pages/SDL-TTF.html-inc index 2602f6d..7693e8e 100644 --- a/pages/SDL-TTF.html-inc +++ b/pages/SDL-TTF.html-inc @@ -189,8 +189,8 @@ SDL does not have to be initialized before this call.

Query the initilization status of the truetype font API. -You may, of course, use this before SDL::TTF::init to avoid initializing twice in a row. Or use this to determine if you need to call -SDL::TTF::quit.

+You may, of course, use this before SDL::TTF::init to avoid initializing twice in a row. Or use this to determine if you need to +call SDL::TTF::quit.

quit

@@ -199,8 +199,8 @@ You may, of course, use this before SDL::TTF::init<

Shutdown and cleanup the truetype font API. -After calling this the SDL::TTF functions should not be used, excepting SDL::TTF::was_init. You may, of course, use SDL::TTF::init to -use the functionality again

+After calling this the SDL::TTF functions should not be used, excepting SDL::TTF::was_init. You may, of course, use +SDL::TTF::init to use the functionality again

Management functions

@@ -791,7 +791,7 @@ your display-surface.

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

SEE ALSO

Top

diff --git a/pages/SDL-Time.html-inc b/pages/SDL-Time.html-inc index c31a184..35768eb 100644 --- a/pages/SDL-Time.html-inc +++ b/pages/SDL-Time.html-inc @@ -88,7 +88,7 @@ This ID is the return value of the SDL::Time::add_timer function.

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL-Tutorial-Animation.html-inc b/pages/SDL-Tutorial-Animation.html-inc index 2f15476..9cab64b 100644 --- a/pages/SDL-Tutorial-Animation.html-inc +++ b/pages/SDL-Tutorial-Animation.html-inc @@ -59,11 +59,11 @@ frame and saving and restoring the background for every object drawn.

Since you have to draw the screen in the right order once to start with it's pretty easy to make this into a loop and redraw things in the right order for -every frame. Given a SDLx::App object $app, a SDL::Rect $rect, and +every frame. Given a SDLx::App object $app, a SDL::Rect $rect, and a SDL::Color $color, you only have to create a new SDL::Rect $bg, representing the whole of the background surface and a new mapped color $bg_color, representing the background color. The colors need to be mapped -to the format of the current display. This is done by SDL::Video::map_RGB.

+to the format of the current display. This is done by SDL::Video::map_RGB.

 

my $color = SDL::Video::map_RGB ( $app->format, @@ -193,7 +193,7 @@ them soon.

chromatic, <chromatic@wgz.org>

Written for and maintained by the Perl SDL project, http://sdl.perl.org/. -See AUTHORS in SDL.

+See /SDL.html#AUTHORS.

BUGS

Top

diff --git a/pages/SDL-Tutorial-LunarLander.html-inc b/pages/SDL-Tutorial-LunarLander.html-inc index 5904c46..9fe2b47 100644 --- a/pages/SDL-Tutorial-LunarLander.html-inc +++ b/pages/SDL-Tutorial-LunarLander.html-inc @@ -432,7 +432,7 @@ of the moon.

COPYRIGHT & LICENSE

Top

\ No newline at end of file diff --git a/pages/SDL-Video.html-inc b/pages/SDL-Video.html-inc index ccf233c..ed3df79 100644 --- a/pages/SDL-Video.html-inc +++ b/pages/SDL-Video.html-inc @@ -615,7 +615,7 @@ filled.

If you call this on the video surface (ie: the value of SDL::Video::get_video_surface) you may have to update the video surface to see the result. This can happen if you are using a shadowed surface that is not double buffered in Windows XP using build 1.2.9.

SDL::Video::fill_rect returns 0 on success or -1 on error.

-

for an example see SYNOPSIS.

+

for an example see http://search.cpan.org/perldoc?.

Surface Locking and Unlocking

Top

@@ -1443,7 +1443,7 @@ is experimental).

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

SEE ALSO

Top

diff --git a/pages/SDL-VideoInfo.html-inc b/pages/SDL-VideoInfo.html-inc index 0e52a46..7f2fe9b 100644 --- a/pages/SDL-VideoInfo.html-inc +++ b/pages/SDL-VideoInfo.html-inc @@ -174,7 +174,7 @@

AUTHORS

Top

-

See AUTHORS in SDL.

+

See /SDL.html#AUTHORS.

\ No newline at end of file diff --git a/pages/SDL.html-inc b/pages/SDL.html-inc index c5147c2..75f9b1f 100644 --- a/pages/SDL.html-inc +++ b/pages/SDL.html-inc @@ -240,7 +240,7 @@ The actual delay may be longer than specified depending on the underlying OS.

See the impact graph on our github repository.

Andy Bakun <sdlperl@thwartedefforts.org>

Benedikt Meurer <bmeurer@fwdn.de>

-

Blaise Roth (Blaizer) <blaiseroth@gmail.com>

+

Blaise Roth (Blaizer) <blaizer@cpan.org>

Breno G. de Oliveira (garu)

Brian Cassidy (bricas)

chromatic <chromatic@wgz.org>

diff --git a/pages/SDLx-App.html-inc b/pages/SDLx-App.html-inc index 6c6b72f..df87986 100644 --- a/pages/SDLx-App.html-inc +++ b/pages/SDLx-App.html-inc @@ -5,6 +5,7 @@
  • NAME
  • CATEGORY
  • SYNOPSIS
  • +
  • DESCRIPTION
  • METHODS @@ -69,9 +70,12 @@ } -

    An alternative to the manual Event processing is through the SDLx::Controller module. SDLx::App is a Controller so see the CALLBACKS section below. -=head1 DESCRIPTION

    -

    SDLx::App controls the root window of the of your SDL based application. +

    An alternative to the manual Event processing is through the SDLx::Controller module. SDLx::App is a Controller so see the CALLBACKS section below.

    + + +

    DESCRIPTION

    Top

    +
    +

    SDLx::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.

    @@ -102,6 +106,8 @@ Screen depth. Defaults to 16. Shortcut: 'd'. Any flags you want to pass to SDL::Video upon initialization. Defaults to SDL_ANYFORMAT. Flags should be or'ed together if you're passing more than one (flags => FOO|BAR). Shortcut: 'f'.
    * resizeable Set this to a true value to make the window resizeable by the user. Default is off.
    +
    * exit_on_quit +Set this to a true value to make the app exit if a SDL_QUIT event is triggered. Shortcut: 'eoq'.
    @@ -209,12 +215,12 @@ always returns the current value of the given attribute, or Carp::confesss on fa $app->run(); -

    see SDLx::Controller for more details.

    +

    see SDLx::Controller for more details.

    AUTHORS

    Top

    -

    See AUTHORS in SDL.

    +

    See /SDL.html#AUTHORS.

    SEE ALSO

    Top

    diff --git a/pages/SDLx-Controller-Interface.html-inc b/pages/SDLx-Controller-Interface.html-inc index 538df77..22ea183 100644 --- a/pages/SDLx-Controller-Interface.html-inc +++ b/pages/SDLx-Controller-Interface.html-inc @@ -171,7 +171,7 @@ callback.

    AUTHORS

    Top

    -

    See AUTHORS in SDL.

    +

    See /SDL.html#AUTHORS.

    \ No newline at end of file diff --git a/pages/SDLx-Controller-State.html-inc b/pages/SDLx-Controller-State.html-inc new file mode 100644 index 0000000..8e64553 --- /dev/null +++ b/pages/SDLx-Controller-State.html-inc @@ -0,0 +1,117 @@ +
    + +

    Index

    + +
    + + +

    NAME

    Top

    +
    +

    SDLx::Controller::State - the state of a SDLx::Controller::Interface

    + +
    +

    CATEGORY

    Top

    +
    +

    Extension, Controller

    + +
    +

    SYNOPSIS

    Top

    +
    +
      # you'll most likely get a State object from a SDLx::Controller::Interface
    +  # object. Just in case, here's how you would construct one by hand:
    +  my $state1 = SDLx::Controller::State->new;
    +  my $state2 = SDLx::Controller::State->new( $x, $y, $v_x, $v_y, $rotation, $ang_v );
    +
    +  # attributes are just simple accessors:
    +  $state->x(10);
    +  $state->x;      # 10
    +
    +  # same goes for the rest:
    +  $state->y;
    +  $state->ang_v;
    +
    +  # etc.
    +
    +
    + +
    +

    DESCRIPTION

    Top

    +
    +

    A state object is a simple container for any given state inside a running +SDLx::Controller::Interface instance.

    + +
    +

    METHODS

    Top

    +
    + +
    +

    new()

    +
    + +
    +

    new( $x, $y, $v_x, $v_y, $rotation, $ang_v )

    +
    +

    Creates a new state container object. Can optionally set the initial value +of all its attributes (see below).

    + +
    +

    ACCESSORS

    Top

    +
    + +
    +

    x

    +
    +

    Accessor to get/set the x value, usually used to position the item or check for collisions.

    + +
    +

    y

    +
    +

    Accessor to get/set the y value, usually used to position the item or check for collisions.

    + +
    +

    v_x

    +
    +

    Accessor to get/set the x velocity of the instance, for moving objects dynamically.

    + +
    +

    v_y

    +
    +

    Accessor to get/set the y velocity of the instance, for moving objects dynamically.

    + +
    +

    rotation

    +
    +

    Accessor to get/set the rotation of the object, in degrees (0..360).

    + +
    +

    ang_v

    +
    +

    Accessor to get/set the angular velocity, for rotating objects dynamically.

    + +
    +

    AUTHORS

    + +
    \ No newline at end of file diff --git a/pages/SDLx-Controller.html-inc b/pages/SDLx-Controller.html-inc index 3851fa2..7cf82d5 100644 --- a/pages/SDLx-Controller.html-inc +++ b/pages/SDLx-Controller.html-inc @@ -48,28 +48,29 @@

    SYNOPSIS

    Top

    -
      use SDLx::Controller;
    +
     use SDLx::Controller;
     
    -  # create our controller object
    -  my $app = SDLx::Controller->new;
    -
    -  # register some callbacks
    -  $app->add_event_handler( \&on_event );
    -  $app->add_move_handler( \&on_move );
    -  $app->add_show_handler( \&on_show );
    -
    -  # run our game loop
    -  $app->run;
    + # create our controller object
    + my $app = SDLx::Controller->new;
     
    + # we could also do:
    + my $app = SDLx::App->new;
    + # because App is also a controller
     
    + # register some callbacks
    + $app->add_event_handler( \&on_event );
    + $app->add_move_handler( \&on_move );
    + $app->add_show_handler( \&on_show );
     
    + # run our game loop
    + $app->run;
     
     

    DESCRIPTION

    -

    The core of a SDL application/game is the main loop, where you handle events +

    The core of an SDL application/game is the main loop, where you handle events and display your elements on the screen until something signals the end of the program. This usually goes in the form of:

      while (1) {
    @@ -109,10 +110,10 @@ It is only when you change the dt without changing all the things i
     If you lower the dt, everything will move faster than it did with it set higher, and vice-versa.
     This is useful to add slo-mo and fast-forward features to the game, all you would have to do is change the dt.

    min_t specifies the minimum time, in seconds, that has to accumulate before any move or show handlers are called, and defaults to 1 / 60. -Having the min_t to 1 / 60 ensures that the controller can update the screen at a maximum of 60 times per second. +Having the min_t at 1 / 60 ensures that the controller can update the screen at a maximum of 60 times per second. A "V-Sync" such as this is necessary to prevent video "tear", which occurs when the app is updating faster than the monitor can display. -Setting it to 0, as in the example, will let the app run as fast as it possibly can.

    -

    event is a SDL::Event object that events going to the event callbacks are polled in to. Defaults to SDL::Event->new().

    +Setting it to 0, as seen above, will let the app run as fast as it possibly can.

    +

    event is a SDL::Event object that events going to the event callbacks are polled in to. It defaults to SDL::Event->new().

    All parameters are optional.

    Returns the new object.

    @@ -142,17 +143,22 @@ Note that the second argument every callback recieves is the SDLx::Control

    Takes 1 argument which is a callback. The application waits for the next event with wait_event. When one is recieved, it is passed to the callback as the first argument, along with the SDLx::Controller object as the second argument. If the callback then returns a true value, pause will return. -If the callback returns a false value, pause will indefinitely wait for more events, repeating the process, until the callback returns true.

    +If the callback returns a false value, pause will repeat the process.

    This can be used to easily implement a pause when the app loses focus:

    -
     sub focus {
    -     my ($e, $controller) = @_;
    -     if($e->type == SDL_ACTIVEEVENT) {
    +
     sub window {
    +     my ($e, $app) = @_;
    +     if($e->type == SDL_QUIT) {
    +		 $app->stop;
    +         # quit handling is here so that the app
    +         # can be stopped while paused
    +     }
    +     elsif($e->type == SDL_ACTIVEEVENT) {
              if($e->active_state & SDL_APPINPUTFOCUS) {
                  if($e->active_gain) {
                      return 1;
                  }
                  else {
    -                 $controller->pause(\&focus);
    +                 $app->pause(\&window);
                      # recursive, but only once since the window
                      # can't lose focus again without gaining is first
                  }
    @@ -178,10 +184,10 @@ The second is the SDLx::Controller object.

     sub stop {
         my ($event, $app) = @_;
         if($event->type == SDL_QUIT) {
    -        $controller->stop;
    +        $app->stop;
         }
      }
    - $controller->add_event_handler(\&stop);
    + $app->add_event_handler(\&stop);
     
     
    @@ -195,7 +201,7 @@ and once more for any remaining time less than dt. The first argument passed to the callbacks is the portion of the step, which will be 1 for a full step, and less than 1 for a partial step. Movement values should be multiplied by this value. The full steps correspond to the amount of dt passed between calls, and the partial step corresponds to the call with the remaining time less than dt. -The argument can be 0 if no time has passed since the last cycle. Set a min_t if you need to protect against this.

    +The argument can be 0 if no time has passed since the last cycle. If you need to protect against this, set a min_t, or put a return unless $_[0] at the start of every move handler.

    The second argument passed to the callbacks is the SDLx::Controller object. The third is the total amount of time passed since the call of run.

    You should use these handlers to update your in-game objects, check collisions, etc. @@ -214,7 +220,7 @@ so you can check and/or update it as necessary.

    Register a callback to render objects. You can add as many subs as you need. Returns the order queue number of the added callback. All registered callbacks will be triggered in order, once per run of the run loop.

    -

    The first argument passed is the number of ticks since the previous call. +

    The first argument passed is the time, in seconds, since the previous call. The second is the SDLx::Controller object.

     sub show_ball {
          my ($delta, $app) = @_;
    @@ -278,7 +284,7 @@ The first coderef in the handler list that this matches will be removed.

    AUTHORS

    Top

    -

    See AUTHORS in SDL.

    +

    See /SDL.html#AUTHORS.

    ACKNOWLEGDEMENTS

    diff --git a/pages/SDLx-Layer.html-inc b/pages/SDLx-Layer.html-inc index a6ec35c..d5b2c57 100644 --- a/pages/SDLx-Layer.html-inc +++ b/pages/SDLx-Layer.html-inc @@ -238,7 +238,7 @@ If you omit $x and $y the layer obtains them via SDL::

    AUTHORS

    Top

    -

    See AUTHORS in SDL.

    +

    See /SDL.html#AUTHORS.

    COPYRIGHT

    Top

    diff --git a/pages/SDLx-LayerManager.html-inc b/pages/SDLx-LayerManager.html-inc index 648d91c..54de0e3 100644 --- a/pages/SDLx-LayerManager.html-inc +++ b/pages/SDLx-LayerManager.html-inc @@ -209,7 +209,7 @@ The other layers are positioned relative to the backmost layer just like before.

    AUTHORS

    Top

    -

    See AUTHORS in SDL.

    +

    See /SDL.html#AUTHORS.

    COPYRIGHT

    Top

    diff --git a/pages/SDLx-Rect.html-inc b/pages/SDLx-Rect.html-inc index 4bee345..8ccb080 100644 --- a/pages/SDLx-Rect.html-inc +++ b/pages/SDLx-Rect.html-inc @@ -285,7 +285,7 @@

    AUTHORS

    Top

    -

    See AUTHORS in SDL.

    +

    See /SDL.html#AUTHORS.

    ACKNOWLEDGEMENTS

    Top

    diff --git a/pages/SDLx-SFont.html-inc b/pages/SDLx-SFont.html-inc index 43f3a4a..5d5d645 100644 --- a/pages/SDLx-SFont.html-inc +++ b/pages/SDLx-SFont.html-inc @@ -80,7 +80,7 @@

    AUTHORS

    Top

    -

    See AUTHORS in SDL.

    +

    See /SDL.html#AUTHORS.

    COPYRIGHT

    Top

    diff --git a/pages/SDLx-Sound.html-inc b/pages/SDLx-Sound.html-inc index bfe5eef..e45afbd 100644 --- a/pages/SDLx-Sound.html-inc +++ b/pages/SDLx-Sound.html-inc @@ -157,7 +157,7 @@

    AUTHORS

    Top

    -

    See AUTHORS in SDL.

    +

    See /SDL.html#AUTHORS.

    COPYRIGHT & LICENSE

    Top

    diff --git a/pages/SDLx-Sprite-Animated.html-inc b/pages/SDLx-Sprite-Animated.html-inc index 5ad93de..6b18355 100644 --- a/pages/SDLx-Sprite-Animated.html-inc +++ b/pages/SDLx-Sprite-Animated.html-inc @@ -139,7 +139,7 @@ If you care, please join the discussion on the #sdl IRC channel in

    ATTRIBUTES AND METHODS

    Top

    -

    SDLx::Sprite::Animated is a subclass of SDLx::Sprite, inheriting +

    SDLx::Sprite::Animated is a subclass of SDLx::Sprite, inheriting all its attributes and methods. Please refer to that module's documentation for information on those.

    The one difference in behavior is that, while a standard SDLx::Sprite uses @@ -342,7 +342,7 @@ automatically for you every time ->draw() is called

    AUTHORS

    Top

    -

    See AUTHORS in SDL.

    +

    See /SDL.html#AUTHORS.

    SEE ALSO

    Top

    diff --git a/pages/SDLx-Sprite.html-inc b/pages/SDLx-Sprite.html-inc index 17b1f46..d58c471 100644 --- a/pages/SDLx-Sprite.html-inc +++ b/pages/SDLx-Sprite.html-inc @@ -329,7 +329,7 @@ destination rect (position) from rect().

    AUTHORS

    Top

    -

    See AUTHORS in SDL.

    +

    See /SDL.html#AUTHORS.

    SEE ALSO

    Top

    diff --git a/pages/SDLx-Surface.html-inc b/pages/SDLx-Surface.html-inc index 34e51ec..8628412 100644 --- a/pages/SDLx-Surface.html-inc +++ b/pages/SDLx-Surface.html-inc @@ -16,10 +16,7 @@ -
  • -
  • EXTENSIONS -
    • load
    • +
    • load
    • blit
    • blit_by
    • flip
    • @@ -99,7 +96,7 @@

      display

      -

      If SDLx::App::new or SDL::Video::get_video_mode called before then:

      +

      If SDLx::App::new or SDL::Video::get_video_mode called before then:

       my $appx = SDLx::Surface::display(); 
       
       
      @@ -112,7 +109,7 @@

      You can also use the keys w and h in place of width and height, as with new.

      -

      Get or create the main display surface and attach to a SDLx::Surface.

      +

      Get or create the main display surface and attach to a SDLx::Surface.

      duplicate

      @@ -136,11 +133,9 @@

      clip_rect

      -

      Sets the passed SDL::Rect as the new clip_rect for the surface. Returns the SDL::Surface's clip_rect. See SDL::Video::get_clip_rect and SDL::Video::set_clip_rect.

      - -
      -

      EXTENSIONS

      Top

      -
      +

      Sets the passed SDL::Rect as the new clip_rect for the surface. Returns the SDL::Surface's clip_rect. See +SDL::Video::get_clip_rect and SDL::Video::set_clip_rect. +=head1 EXTENSIONS

      load

      @@ -172,8 +167,9 @@ supported.

       $sdlx_surface->blit( $dest, $src_rect, $dest_rect );
       
       
      -

      Blits SDLx::Surface onto $dest surface. -$src_rect or $dest_rect are optional. If $src_rect is ommited, it will be the size of the entire surface. If $dest_rect is ommited, it will be blitted at (0, 0). $src_rect or $dest_rect can be array refs or SDL::Rect. $dest can be SDLx::Surface or SDL::Surface.

      +

      Blits SDLx::Surface onto $dest surface. +$src_rect or $dest_rect are optional. If $src_rect is ommited, it will be the size of the entire surface. If $dest_rect is ommited, +it will be blitted at (0, 0). $src_rect or $dest_rect can be array refs or SDL::Rect. $dest can be SDLx::Surface or SDL::Surface.

      Returns $self

      @@ -200,7 +196,8 @@ This is useful when the surface you have isn't an SDLx::Surface, bu $sdlx_surface->update( [ SDL::Rect->new(0,0,1,2) ... ]); # defined rects are updated -

      Applies SDL::Video::update_rect for no rect or 1 array ref. Applies SDL::Video::update_rects for array of SDL::Rects.

      +

      Applies SDL::Video::update_rect for no rect or 1 array ref. Applies +SDL::Video::update_rects for array of SDL::Rects.

      Returns $self

      @@ -276,7 +273,7 @@ This is useful when the surface you have isn't an SDLx::Surface, bu

      AUTHORS

      Top

      -

      See AUTHORS in SDL.

      +

      See /SDL.html#AUTHORS.

      \ No newline at end of file diff --git a/pages/documentation.html-inc b/pages/documentation.html-inc index 21ccb79..8a9e770 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::Sound
      thumbSDLx::Sprite- interact with images quick and easily in SDL
      thumbSDLx::Sprite::Animated- create animated SDL sprites easily!
      thumbSDLx::Surface- Graphic surface matrix extension
      Controller
      thumbSDLx::Controller- Handles the loops for events, movement and rendering
      thumbSDLx::Controller::Interface- Interface Physics and Rendering with the Controller with callbacks

      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
      +

      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::Sound
      thumbSDLx::Sprite- interact with images quick and easily in SDL
      thumbSDLx::Sprite::Animated- create animated SDL sprites easily!
      thumbSDLx::Surface- Graphic surface matrix extension
      Controller
      thumbSDLx::Controller- Handles the loops for events, movement and rendering
      thumbSDLx::Controller::Interface- Interface Physics and Rendering with the Controller with callbacks
      thumbSDLx::Controller::State- the state of a SDLx::Controller::Interface

      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
      diff --git a/tools/PM-Pod2html-snippet.pl b/tools/PM-Pod2html-snippet.pl index 34dd814..dd4f51c 100644 --- a/tools/PM-Pod2html-snippet.pl +++ b/tools/PM-Pod2html-snippet.pl @@ -3,11 +3,12 @@ use strict; use warnings; use Carp; +use Data::Dumper; use Pod::Xhtml; use File::Copy; use File::Spec::Functions qw(rel2abs splitpath splitdir catpath catdir catfile canonpath); -my $input_path = 'D:/dev/SDL_perl/lib/pods'; +my $input_path = 'D:/dev/SDL/lib/pods'; $input_path = $ARGV[0] if $ARGV[0]; my ($volume, $dirs) = splitpath(rel2abs(__FILE__)); @@ -94,6 +95,7 @@ sub read_file read_file($_) if(-d $_); if($_ =~ /\.pod$/i) { + print "Processing $_\n"; my $key = ''; my $file_name = $_; $file_name =~ s/^$input_path\/*//; @@ -174,20 +176,25 @@ sub new return $self; } +my $warn = 0; sub node { my $self = shift; + if($self->SUPER::type() eq 'page') { my $page = $self->SUPER::page(); my $suff = ''; - if($page =~ /^SDL\b/) + if($page =~ /^SDL(x)?\b/) { $page =~ s/::([A-Z]+)/-$1/g; - $page =~ s/(.*)::(.*)/\/$1.html#$2/; + printf "%03d WARNING: " . $self->SUPER::page() . " better written as L<$2|$1/\"$2\">\n", ++$warn if $self->SUPER::page() =~ /(.*)::([a-z_]+)$/; + + $page =~ s/(.*)\/"(.*)"/\/$1.html#$2/; $page .= '.html' unless $page =~ /\.html/; + #print $self->SUPER::page() . " -> " . $page . "\n" if $page =~ /Event/; return $page; } else @@ -195,6 +202,24 @@ sub node return "http://search.cpan.org/perldoc?$page"; } } + elsif($self->SUPER::type() eq 'item') + { + my $page = $self->SUPER::page(); + my $node = $self->SUPER::node(); + my $suff = ''; + + if($page =~ /^SDL(x)?\b/) + { + $page =~ s/::([A-Z]+)/-$1/g; + $node =~ s/"//g; + + return "/$page.html#$node"; + } + else + { + return "http://search.cpan.org/perldoc?$page"; + } + } $self->SUPER::node(@_); } @@ -208,7 +233,7 @@ sub text sub type { my $self = shift; - return "hyperlink" if($self->SUPER::type() eq 'page'); + return "hyperlink" if($self->SUPER::type() =~ /(page|item)/); $self->SUPER::type(@_); }