From: Kartik Thakore The constructor creates a new color with the specified red, green and
-blue values: The constructor creates a new color with the specified red, green and blue values. If passed a value, this method sets the red component of the color;
-if not, it returns the red component of the color: If passed a value, this method sets the red component of the color;
+if not, it returns the red component of the color. If passed a value, this method sets the green component of the color;
-if not, it returns the green component of the color: If passed a value, this method sets the green component of the color;
+if not, it returns the green component of the color. If passed a value, this method sets the blue component of the color;
-if not, it returns the blue component of the color: If passed a value, this method sets the blue component of the color;
+if not, it returns the blue component of the color. You can use OpenGL as needed here. SDLx::App can start an OpenGL application with the parameter -gl => 1. Above we enable GL and set the correct prespective For SDLx::App sync handles the GL buffer clean. Below we can use SDL::Events as normal: Attaching a PDL piddle object to SDL. SDL::Cookbook::PDL
- Attaching a PDL piddle object to SDL. SDL::Cookbook::PDL Starting an OpenGL app with SDLx::App. SDL::Cookbook::OpenGL Sending textures to Perl OpenGL. SDL::Cookbook::POGL SDL::Cursor -- Mouse cursor structure SDL::Cursor - Mouse cursor structure the The SYNOPSIS
my $black = SDL::Color->new( 0, 0, 0);
- my $color = SDL::Color->new(255, 0, 0);
- my $r = $color->r; # 255
- my $g = $color->g; # 0
- my $b = $color->b; # 0
- $color->g(255);
- $color->b(255);
- # $color is now white
+
my $black = SDL::Color->new(0, 0, 0);
+ my $color = SDL::Color->new(255, 0, 0);
+ my $r = $color->r; # 255
+ my $g = $color->g; # 0
+ my $b = $color->b; # 0
+ $color->g(255);
+ $color->b(255);
+ # $color is now white
@@ -53,43 +53,42 @@
new ( $r, $g, $b )
- my $color = SDL::Color->new(255, 0, 0);
+
+new
+ my $color = SDL::Color->new(255, 0, 0);
+r
my $r = $color->r; # 255
- $color->r(128);
+
my $r = $color->r;
+ $color->r(128);
+g
my $g = $color->g; # 255
- $color->g(128);
+
my $g = $color->g;
+ $color->g(128);
+b
my $b = $color->b; # 255
- $color->b(128);
+
my $b = $color->b;
+ $color->b(128);
+SEE ALSO
diff --git a/pages/SDL-Cookbook-OpenGL.html-inc b/pages/SDL-Cookbook-OpenGL.html-inc
index 11328ab..663bfd4 100644
--- a/pages/SDL-Cookbook-OpenGL.html-inc
+++ b/pages/SDL-Cookbook-OpenGL.html-inc
@@ -45,7 +45,9 @@
use SDL::Event;
use OpenGL qw(:all);
- my ($SDLAPP, $WIDTH, $HEIGHT, $SDLEVENT);
+ my ($SDLAPP, $WIDTH, $HEIGHT, $SDLEVENT);
$| = 1;
$WIDTH = 1024;
@@ -53,19 +55,17 @@
$SDLAPP = SDLx::App->new(-title => "Opengl App", -width => $WIDTH, -height => $HEIGHT, -gl => 1);
$SDLEVENT = SDL::Event->new;
-
-
-
- glEnable(GL_DEPTH_TEST);
+
+ glEnable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glLoadIdentity;
gluPerspective(60, $WIDTH / $HEIGHT, 1, 1000);
glTranslatef(0, 0, -20);
-
-
-
- while (1) {
+
+ while (1) {
&handlepolls;
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glRotatef(.1, 1, 1, 1);
@@ -73,13 +73,9 @@
$SDLAPP->sync;
}
-
-
-
-
-
-
- sub drawscene {
+
+ sub drawscene {
my ($color, $x, $y, $z);
for (-2 .. 2) {
@@ -96,15 +92,6 @@
-
-
-
-
-
-
-
-
-
sub draw_cube {
my (@indices, @vertices, $face, $vertex, $index, $coords);
@@ -131,16 +118,9 @@
return "";
}
-
-
-
-
-
-
-
-
-
- sub handlepolls {
+
+ sub handlepolls {
my ($type, $key);
SDL::Events::pump_events();
@@ -168,7 +148,7 @@
SEE ALSO
PDL with SDL
POGL with SDL
+NAME
CATEGORY
@@ -34,7 +34,8 @@
$width,
$height,
$hotspot_left,
- $hotspot_top );
+ $hotspot_top
+ );
SDL::Mouse::set_cursor($cursor);
@@ -43,9 +44,8 @@
DESCRIPTION
SDL::Cursor
module handles mouse cursors, and provide the developer to
-use custom made cursors. Note that the cursors can only be in black and
-white.SDL::Cursor
module handles mouse cursors, and allows the developer to use custom-made cursors.
+Note that cursors can only be in black and white.METHODS
@@ -54,8 +54,13 @@ white.
Create a cursor using the specified data and mask (in MSB format). The cursor width must be a multiple of 8 bits.
-The cursor is created in black and white according to the following:
+my $cursor = SDL::Cursor->new( + \@data, \@mask, $width, $height, $hotspot_left, $hotspot_top + ); + ++
Create a cursor using the specified data and mask (in MSB format). +The cursor is created in black and white according to the following:
Data / Mask Resulting pixel on screen 0 / 1 White 1 / 1 Black @@ -63,17 +68,17 @@ white. 1 / 0 Inverted color if possible, black if not.-
Cursors created with this function must be freed with SDL_FreeCursor.
-If you want to have color cursor, then this function is not for you; instead, you must hide normal system cursor with SDL::Cursor-
new>
-and in your main loop, when you draw graphics, also draw a SDL::Surface
at the location of the mouse cursor.
If you want to have color cursor, then this function is not for you.
+Instead, you should hide the cursor with SDL::Mouse::show_cursor(SDL_DISABLE)
.
+Then in your main loop, when you draw graphics, draw a SDL::Surface
at the location of the mouse cursor.
Example:
use SDL;
- use SDL::Cursor;
- use SDL::Mouse;
use SDL::Video;
+ use SDL::Mouse;
+ use SDL::Cursor;
SDL::init(SDL_INIT_VIDEO);
- SDL::Video::set_video_mode( 640, 480, 16, SDL_SWSURFACE);
+ SDL::Video::set_video_mode(640, 480, 16, SDL_SWSURFACE);
my @data = (
0b00000000,
@@ -85,7 +90,6 @@ and in your main loop, when you draw graphics, also draw a SDL::SurfaceSDL::Surface
+The width of cursors work in groups of 8.
+If the width is above 8, twice the amount of elements in @data
and @mask
are required.
+If the width is above 16, three times are required, and so on.
+For example, if you wanted a 9 pixel crosshair you might do the following:
+ my @data = (
+ 0b00001000,0b00000000,
+ 0b00001000,0b00000000,
+ 0b00001000,0b00000000,
+ 0b00001000,0b00000000,
+ 0b11111111,0b10000000,
+ 0b00001000,0b00000000,
+ 0b00001000,0b00000000,
+ 0b00001000,0b00000000,
+ 0b00001000,0b00000000,
+ );
+ my @mask = @data;
+
+ my $cursor = SDL::Cursor->new(\@data, \@mask, 9, 9, 4, 4);
+
+
+The hotspot is offset by 4 pixels because a crosshair clicks from the center instead of the top left.
David J. Goehrig, Tobias Leich
+David J. Goehrig, Tobias Leich, Blaizer
SDL::Mouse -- SDL Bindings for the Mouse device
+SDL::Mouse - SDL Bindings for the Mouse device
Core, Mouse
+The constants for SDL::Mouse belong to SDL::Events/SDL::Event, under the export tag of ':state'
.
void warp_mouse( int $x, int $y ); +SDL::Mouse::warp_mouse( $x, $y );-Set the position of the mouse cursor (generates a mouse motion event).
+Set the position of the mouse cursor (generates a mouse motion event). +Even if the mouse is warped to where it currently is, a mouse motion event is generated.
void set_cursor( object ); +SDL::Mouse::set_cursor( $cursor_object );-Sets the currently active cursor to the specified one. If the cursor is currently visible, the change will be immediately represented -on the display.
+set_cursor()
can be used to force cursor redraw, if this is desired for any reason.Sets the currently active cursor to the specified one. +See SDL::Cursor for details on cursor objects. +If the cursor is currently visible, the change will be immediately represented on the display. +
set_cursor()
can be used to force cursor redraw, if this is desired for any reason.
object get_cursor(); +my $cursor_object = SDL::Mouse::get_cursor;Gets the currently active mouse cursor.
@@ -56,17 +66,19 @@ on the display.set_cursor()
can be used to force cursor redraw, if
int show_cursor( int toggle ); +my $return = SDL::Mouse::show_cursor( $state );-Toggle whether or not the cursor is shown on the screen. Passing
SDL_ENABLE
displays the cursor and passingSDL_DISABLE
hides it. +Toggle whether or not the cursor is shown on the screen. +Passing
SDL_ENABLE
displays the cursor and passingSDL_DISABLE
hides it. The current state of the mouse cursor can be queried by passingSDL_QUERY
, eitherSDL_DISABLE
orSDL_ENABLE
will be returned.use SDL; use SDL::Mouse; use SDL::Video; + use SDL::Events ':state'; #For the constants SDL::init(SDL_INIT_VIDEO); - SDL::Video::set_video_mode( 640, 480, 16, SDL_SWSURFACE); + SDL::Video::set_video_mode(640, 480, 16, SDL_SWSURFACE); printf("Cursor is %s\n", SDL::Mouse::show_cursor(SDL_QUERY) ? 'visible' : 'not visible'); @@ -85,4 +97,9 @@ The current state of the mouse cursor can be queried by passingSDL_QUERY<
my $rect = SDL::Rect->new( 0, 0, 0, 0 ); - $rect->x(1); - $rect->y(2); - $rect->w(3); - $rect->h(4); - my $x = $rect->x; # 1 - my $y = $rect->y; # 2 - my $w = $rect->w; # 3 - my $h = $rect->h; # 4 +my $rect = SDL::Rect->new(0, 0, 50, 4); + $rect->x(1); + $rect->y(2); + $rect->w(3); + my $x = $rect->x; # 1 + my $y = $rect->y; # 2 + my $w = $rect->w; # 3 + my $h = $rect->h; # 4@@ -55,53 +54,52 @@-new ( $x, $y, $w, $h )
--The constructor creates a new rectangle with the specified x, y, w, h -values:
-my $rect = SDL::Rect->new( 0, 0, 0, 0 ); +new
++my $rect = SDL::Rect->new( $x, $y, $w, $h );+The constructor creates a new rectangle with the specified x, y, width and height values.
x
-If passed a value, this method sets the x component of the rectangle; -if not, it returns the x component of the rectangle:
-my $x = $rect->x; # 255 - $rect->x(128); +my $x = $rect->x; + $rect->x(128);+If passed a value, this method sets the x component of the rectangle; +if not, it returns the x component of the rectangle.
y
-If passed a value, this method sets the y component of the rectangle; -if not, it returns the y component of the rectangle:
-my $y = $rect->y; # 255 - $rect->y(128); +my $y = $rect->y; + $rect->y(128);+If passed a value, this method sets the y component of the rectangle; +if not, it returns the y component of the rectangle.
w
-If passed a value, this method sets the w component of the rectangle; -if not, it returns the w component of the rectangle:
-my $w = $rect->w; # 255 - $rect->w(128); +my $w = $rect->w; + $rect->w(128);+If passed a value, this method sets the w component of the rectangle; +if not, it returns the w component of the rectangle.
h
-If passed a value, this method sets the h component of the rectangle; -if not, it returns the h component of the rectangle:
-my $h = $rect->h; # 255 - $rect->h(128); +my $h = $rect->h; + $rect->h(128);+If passed a value, this method sets the h component of the rectangle; +if not, it returns the h component of the rectangle.
SEE ALSO
diff --git a/pages/SDL-Surface.html-inc b/pages/SDL-Surface.html-inc index 83709ba..6fe35f3 100644 --- a/pages/SDL-Surface.html-inc +++ b/pages/SDL-Surface.html-inc @@ -8,27 +8,17 @@- DESCRIPTION
- CONSTANTS
- METHODS -
- Direct Write to Surface Pixel
@@ -39,7 +29,7 @@NAME
-SDL::Surface - Graphic surface structure.
+SDL::Surface - Graphic surface structure
CATEGORY
@@ -49,17 +39,17 @@SYNOPSIS
-The main surface (display) is provided by SDL::Video::set_video_mode. - use SDL; #provides flags & constants - use SDL::Video; #provides access to set_video_mode - use SDL::Surface; #provides access to SDL_Surface struct internals
-SDL::init(SDL_INIT_VIDEO); - my $display = SDL::Video::set_video_mode(); +use SDL; + use SDL::Video; + use SDL::Surface; --All surfaces constructed from now on are attached to the $display. There are two constructors available to do this.
-my $surface = SDL::Surface->new ( ... ); - my $surface2 = SDL::Surface->new_from ( surface, ... ); + # Create the main surface (display) + SDL::init(SDL_INIT_VIDEO); + my $display = SDL::Video::set_video_mode(640, 480, 16, SDL_SWSURFACE); + + # Create other surfaces attached to the $display. + my $surface = SDL::Surface->new(SDL_ASYNCBLIT | SDL_HWSURFACE, 640, 480, 16, 0, 0, 0, 0); + my $surface2 = SDL::Surface->new_from($surface, 100, 100, 8, 0, 0, 0, 0);@@ -71,47 +61,7 @@CONSTANTS
--The constants are exported by default. You can avoid this by doing:
-use SDL::Video (); - --and access them directly:
-SDL::Video::SDL_SWSURFACE; - --Available constants: see flags
- -METHODS
-- --new ( flags, width, height, depth, Rmask, Gmask, Bmask, Amask )
---The constructor creates a new surface with the specified parameter values.
-my $surface = SDL::Surface->new( ... ); - -- -new_from ( surface, width, height, depth, Rmask, Gmask, Bmask, Amask )
---The constructor creates a new surface with the specified parameter values.
-my $surface = SDL::Surface->new_from( $old_surface, ... ); - - - - -- -Construtor Parameters
-- --flags
--+Available flags for new() are exported by SDL::Video
+The constants for SDL::Surface belong to SDL::Video, under the export tag of
':surface'
.
- SDL_ASYNCBLIT
- @@ -119,37 +69,67 @@
- SDL_SWSURFACE
- -
Stored in the system memory.
+Store in system memory
- SDL_HWSURFACE
- -
Stored in video memory
+Store in video memory
METHODS
++ ++new
+++my $surface = SDL::Surface->new( + $flags, $width, $height, $depth, $Rmask, $Gmask, $Bmask, $Amask + ); + ++The constructor creates a new surface with the specified parameter values.
+The four mask values are the bits that the channel will ignore. +For example, an Rmask of
+ +0xFF
will ignore that channel completely, making everything on the surface more green/blue.new_from
++my $surface = SDL::Surface->new_from( + $surface, $width, $height, $depth, $Rmask, $Gmask, $Bmask, $Amask + ); + ++The constructor creates a new surface with the specified parameter values. +The flags are taken from the specified
+ +$surface
.w
-SDL::Surface width are defined at construction. Thus the following is read only.
-my $w = $surface->w; +my $w = $surface->w;+Returns the width of the surface. +SDL::Surface width is defined at construction so this is read-only.
h
-SDL::Surface height are defined at construction. Thus the following is read only.
-my $h = $surface->h; +my $h = $surface->h;+Returns the height of the surface. +SDL::Surface height is defined at construction so this is read-only.
format
-The format of the pixels stored in the surface. See SDL::PixelFormat
my $format = $surface->format;+The format of the pixels stored in the surface. +See SDL::PixelFormat
pitch
@@ -157,35 +137,22 @@my $pitch = $surface->pitch;-SDL::Surface's scanline length in bytes
- -
To get the surface's clip_rect we the following
-my $clip_rect = SDL::Rect->new(0,0,0,0); - SDL::Video::get_clip_rect($surface, $clip_rect); - --
To set the surface's clip_rect use the following
-my $clip_rect = SDL::Rect->new(2,23,23,542); - SDL::Video::set_clip_rect($surface, $clip_rect); - -+
The scanline length in bytes.
Disclaimer: This can be very slow, it is suitable for creating surfaces one time and not for animations
+Disclaimer: The following methods can be very slow, making them suitable for creating surfaces, but not for animations
my $pixel = $surface->get_pixel( $offset ) +my $pixel = $surface->get_pixel( $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.
+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.
$surface->set_pixels( $offset, $value );-
Sets the current pixel $value
to the given $offset
. The pixel value must fit the pixel format of the surface.
Sets the 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.
- - -sub putpixel - { - my($x, $y, $color) = @_; - $screen->set_pixels( $x + $y * $screen->w, $color); +Example:
+sub putpixel { + my ($x, $y, $color) = @_; + $display->set_pixels( $x + $y * $display->w, $color); }-See also examples/sols/ch02.pl
+See also examples/pixel_operations/sols/ch02.pl!
$surface->get_pixels_ptr(); +my $ptr = $surface->get_pixels_ptr;-Returns the C ptr to this surfaces's pixels
- - - - - - - +Returns a reference to the surface's pixels.
use threads; +use warnings; + use strict; + + use threads; use threads::shared; - use SDL ':all'; use SDL::Time; package foo; + use SDL ':all'; + SDL::init(SDL_INIT_TIMER); my $tick :shared = 0; @@ -54,12 +58,16 @@-add_timer(interval, callback)
--This runs in a separate thread and a cloned Perl thread.
-The
callback
function, specified with a string of the function's name, will be called after the milliseconds ofinterval
have elapsed. +add_timer
++-my $id = SDL::Timer::add_timer( $ms_interval, $callback ); + ++This runs in a separate thread and a cloned Perl thread. +
+threads
andthreads::shared
must be used to share any variables the timer uses.The
$callback
function, specified with a string of the function's name, will be called after the milliseconds of$interval
have elapsed. The actual delay may be longer than specified depending on the underlying OS. -The callback function is passed the current timer interval as well as theinterval
parameter and should return the next timer interval. +The callback function is passed the current timer interval as well as the$interval
parameter and should return the next timer interval. If the return value from the callback is 0, the timer is cancelled; otherwise, the timer will continue to run.The timer callback function may run in a different thread to your main program, so it shouldn't call any functions from within itself. You may call SDL::push_event, however.
@@ -67,10 +75,13 @@ You may call SDL::push_event, however.Note: You must initialize (
SDL::init
) the timer subsystem to use this function.remove_timer(id)
--The other way to cancel a timer is to use
+SDL::Time::remove_timer
on theid
of a timer. -Thisid
is the return value of theSDL::Time::remove_timer
function.remove_timer
++diff --git a/pages/SDL-Version.html-inc b/pages/SDL-Version.html-inc index 97af187..512c582 100644 --- a/pages/SDL-Version.html-inc +++ b/pages/SDL-Version.html-inc @@ -7,9 +7,9 @@SDL::Timer::remove_timer( $id ); + ++The other way to cancel a timer is to use
SDL::Time::remove_timer
on the$id
of a timer. +This ID is the return value of theSDL::Time::add_timer
function.
SDL::Time::remove_timer
returns0
on success or-1
on error.- SYNOPSIS
- DESCRIPTION
- METHODS -
- major()
-- minor()
-- patch() +
@@ -47,24 +47,26 @@DESCRIPTION
The
+TheSDL::Version
structure is used by theSDL::linked_version
function and theSDL::version
macro. -TheSDL::linked_version
function returns the link-time SDL version whereasSDL::version
returns the compile-time SDL version.SDL::linked_version
function returns the link-time SDL version whereasSDL::version
returns the compile-time SDL version. +Note: This is the SDL version, not the SDL_Perl version. +The SDL_Perl version is in$SDL::VERSION
.METHODS
-major()
+major
-Returns the major version number.
minor()
+minor
-Returns the minor version number.
patch()
+patch
Returns the patch version number.
diff --git a/pages/SDL.html-inc b/pages/SDL.html-inc index 73216f2..ee6419f 100644 --- a/pages/SDL.html-inc +++ b/pages/SDL.html-inc @@ -8,21 +8,21 @@- DESCRIPTION
- CONSTANTS
- METHODS -
-- AUTHORS +
- AUTHOR
@@ -79,44 +79,59 @@ For the object oriented programming interface please see the documentation provi-init(flags)
-+init
++-SDL::init( $flags ); + +As with the C language API, SDL Perl initializes the SDL environment with the
+TheSDL::init
subroutine. This routine takes a mode flag constructed through the bitwise OR product of theSDL_INIT_*
constants. -Theflags
tellSDL::init
which subsystems to initialize.$flags
tellSDL::init
which subsystems to initialize.SDL::init(SDL_INIT_AUDIO | SDL_INIT_JOYSTICK);
SDL::init
returns0
on success, or-1
on error.init_subsystem(flags)
--After
+SDL
has been initialized withSDL::init
you may initialize any uninitialized subsystems withSDL::init_subsystem
. -Theflags
tellSDL::init_subsystem
which subsystems to initialize, and are taken in the same way asSDL::init
.init_subsystem
++-SDL::init_subsystem( $flags ); + ++After SDL has been initialized with
SDL::init
you may initialize any uninitialized subsystems withSDL::init_subsystem
. +The$flags
tellSDL::init_subsystem
which subsystems to initialize, and are taken in the same way asSDL::init
.
SDL::init_subsystem
returns0
on success, or-1
on error.quit_subsystem(flags)
-+quit_subsystem
++-SDL::quit_subsystem( $flags ); + ++The
SDL::quit_subsystem
allows you to shut down a subsystem that has been previously initialized bySDL::init
orSDL::init_subsystem
. -Theflags
tellSDL::quit_subsystem
which subsystems to shut down, and are taken in the same way asSDL::init
.$flags
tellSDL::quit_subsystem
which subsystems to shut down, and are taken in the same way asSDL::init
.
SDL::quit_subsystem
doesn't return any values.quit()
+quit
+-SDL::quit; + +
SDL::quit
Shuts down all SDL subsystems, unloads the dynamically linked library and frees the allocated resources.Note: This will be called automatically when Perl exits. You don't need to call this, except if you want to initialize SDL again after this.
SDL::quit
doesn't return any values.was_init(flags)
-+was_init
++-my $flags = SDL::was_init( $flags ); + ++The
SDL::was_init
allows you to see which SDL subsytems have been initialized. -Theflags
tellSDL::was_init
which subsystems to check, and are taken in the same way asSDL::init
.$flags
tellSDL::was_init
which subsystems to check, and are taken in the same way asSDL::init
.+If
SDL::was_init
returns a mask of the initialized subsystems it checks. -Ifflags
is0
orSDL_INIT_EVERYTHING
, a mask of all initialized subsystems will be returned (this does not includeSDL_INIT_EVENTTHREAD
orSDL_INIT_NOPARACHUTE
).$flags
is0
orSDL_INIT_EVERYTHING
, a mask of all initialized subsystems will be returned (this does not includeSDL_INIT_EVENTTHREAD
orSDL_INIT_NOPARACHUTE
).use SDL ':all'; my $mask = SDL::was_init(SDL_INIT_AUDIO | SDL_INIT_JOYSTICK); @@ -127,49 +142,67 @@ Ifflags
is0
orSDL_INIT_EVERYTHING
, a mget_error()
+get_error
+-my $error = SDL::get_error; + +Returns a scalar value containing the last error message set by the SDL library (if any).
set_error_real(error, @values)
-+set_error_real
++-SDL::set_error_real( $printf_format, @values ) + +
SDL::set_error_real
sets the SDL error to aprintf
style formatted string.
SDL::set_error_real
doesn't return any values.clear_error()
+clear_error
+-SDL::clear_error; + +
SDL::clear_error
deletes all information about the last SDL error. This is useful if the error has been handled by the program.
SDL::clear_error
doesn't return any values.version()
+version
+-my $version = SDL::version; + +Returns an
SDL::Version
object of the SDL library at compile-time.use SDL; use SDL::Version; - my $v = SDL::version(); + my $v = SDL::version; printf("got version: %d.%d.%d\n", $v->major, $v->minor, $v->patch);linked_version()
+linked_version
-
SDL::linked_version
works in the same way asSDL::version
, but returns anSDL::Version
object of the SDL library at link-time.get_ticks()
+get_ticks
+-my $ticks = SDL::get_ticks; + +Returns the number of milliseconds since SDL library initialization. This value wraps around if the program runs for more than 49.7 days
delay(ms)
-+delay
++-SDL::delay( $ms ); + +
SDL::delay
waits the specified number of milliseconds before returning. The actual delay may be longer than specified depending on the underlying OS.@@ -179,8 +212,8 @@ The actual delay may be longer than specified depending on the underlying OS.
SDL::delay
doesn't return anything.AUTHORS
-+AUTHOR
+diff --git a/pages/documentation.html-inc b/pages/documentation.html-inc index 082b192..7328895 100644 --- a/pages/documentation.html-inc +++ b/pages/documentation.html-inc @@ -1,2 +1,2 @@magnet, kthakore, Blaizer
-+Documentation (latest development branch)
Core SDL - Simple DirectMedia Layer for Perl SDL::Credits - Authors and contributors of the SDL Perl project SDL::Time - An SDL Perl extension for managing timers
Audio SDL::Audio - SDL Bindings for Audio
Structure SDL::AudioCVT - Audio Conversion Structure SDL::AudioSpec - SDL Bindings for structure SDL::AudioSpec
CDROM SDL::CDROM - SDL Bindings for the CDROM device
Structure SDL::CD - SDL Bindings for structure SDL_CD SDL::CDTrack - SDL Bindings for structure SDL_CDTrack
Events SDL::Events - Bindings to the Events Category in SDL API
Structure SDL::Event - General event structure
Joystick SDL::Joystick - SDL Bindings for the Joystick device
Mouse SDL::Mouse - SDL Bindings for the Mouse device
Structure SDL::Cursor - Mouse cursor structure
Structure SDL::Version - SDL Bindings for structure SDL_Version
Video SDL::Video - Bindings to the video category in SDL API
Structure SDL::Color - Format independent color description SDL::Overlay - YUV Video overlay SDL::Palette - Color palette for 8-bit pixel formats SDL::PixelFormat - Stores surface format information SDL::Rect - Defines a rectangular area SDL::Surface - Graphic surface structure. SDL::VideoInfo - Video Target Information
Cookbook SDL::Cookbook SDL::Cookbook::OpenGL - Using SDL with OpenGL SDL::Cookbook::PDL
Extension SDLx::App - a SDL perl extension
GFX SDL::GFX::Framerate - framerate calculating functions SDL::GFX::Primitives - basic drawing functions
Structure SDL::GFX::FPSManager - data structure used by SDL::GFX::Framerate
Image SDL::Image - Bindings for the SDL_Image library
Mixer SDL::Mixer - Sound and music functions SDL::Mixer::Channels - SDL::Mixer channel functions and bindings SDL::Mixer::Effects - sound effect functions SDL::Mixer::Groups - Audio channel group functions SDL::Mixer::Music - functions for music SDL::Mixer::Samples - functions for loading sound samples
Structure SDL::Mixer::MixChunk - SDL Bindings for structure SDL_MixChunk SDL::Mixer::MixMusic - SDL Bindings for structure SDL_MixMusic
Pango SDL::Pango - Text rendering engine
Structure SDL::Pango::Context - Context object for SDL::Pango
TODO SDL::MPEG - a SDL perl extension SDL::SMPEG - a SDL perl extension
MultiThread SDL::MultiThread - Bindings to the MultiThread category in SDL API
Structure SDL::RWOps - SDL Bindings to SDL_RWOPs
GFX SDL::GFX::BlitFunc - blitting functions SDL::GFX::ImageFilter - image filtering functions SDL::GFX::Rotozoom - rotation and zooming functions for surfaces
TTF SDL::TTF - True Type Font functions (libfreetype)
Structure SDL::TTF::Font - Font object type for SDL_ttf
Tutorials SDL::Tutorial - introduction to Perl SDL SDL::Tutorial::Animation SDL::Tutorial::LunarLander - a small tutorial on Perl SDL Documentation (latest development branch)
Core SDL - Simple DirectMedia Layer for Perl SDL::Credits - Authors and contributors of the SDL Perl project SDL::Time - An SDL Perl extension for managing timers
Audio SDL::Audio - SDL Bindings for Audio
Structure SDL::AudioCVT - Audio Conversion Structure SDL::AudioSpec - SDL Bindings for structure SDL::AudioSpec
CDROM SDL::CDROM - SDL Bindings for the CDROM device
Structure SDL::CD - SDL Bindings for structure SDL_CD SDL::CDTrack - SDL Bindings for structure SDL_CDTrack
Events SDL::Events - Bindings to the Events Category in SDL API
Structure SDL::Event - General event structure
Joystick SDL::Joystick - SDL Bindings for the Joystick device
Mouse SDL::Mouse - SDL Bindings for the Mouse device
Structure SDL::Cursor - Mouse cursor structure
Structure SDL::Version - SDL Bindings for structure SDL_Version
Video SDL::Video - Bindings to the video category in SDL API
Structure SDL::Color - Format independent color description SDL::Overlay - YUV Video overlay SDL::Palette - Color palette for 8-bit pixel formats SDL::PixelFormat - Stores surface format information SDL::Rect - Defines a rectangular area SDL::Surface - Graphic surface structure SDL::VideoInfo - Video Target Information
Cookbook SDL::Cookbook SDL::Cookbook::OpenGL - Using SDL with OpenGL SDL::Cookbook::PDL
Extension SDLx::App - a SDL perl extension
GFX SDL::GFX::Framerate - framerate calculating functions SDL::GFX::Primitives - basic drawing functions
Structure SDL::GFX::FPSManager - data structure used by SDL::GFX::Framerate
Image SDL::Image - Bindings for the SDL_Image library
Mixer SDL::Mixer - Sound and music functions SDL::Mixer::Channels - SDL::Mixer channel functions and bindings SDL::Mixer::Effects - sound effect functions SDL::Mixer::Groups - Audio channel group functions SDL::Mixer::Music - functions for music SDL::Mixer::Samples - functions for loading sound samples
Structure SDL::Mixer::MixChunk - SDL Bindings for structure SDL_MixChunk SDL::Mixer::MixMusic - SDL Bindings for structure SDL_MixMusic
Pango SDL::Pango - Text rendering engine
Structure SDL::Pango::Context - Context object for SDL::Pango
TODO SDL::MPEG - a SDL perl extension SDL::SMPEG - a SDL perl extension
MultiThread SDL::MultiThread - Bindings to the MultiThread category in SDL API
Structure SDL::RWOps - SDL Bindings to SDL_RWOPs
GFX SDL::GFX::BlitFunc - blitting functions SDL::GFX::ImageFilter - image filtering functions SDL::GFX::Rotozoom - rotation and zooming functions for surfaces
TTF SDL::TTF - True Type Font functions (libfreetype)
Structure SDL::TTF::Font - Font object type for SDL_ttf
Tutorials SDL::Tutorial - introduction to Perl SDL SDL::Tutorial::Animation SDL::Tutorial::LunarLander - a small tutorial on Perl SDL