From: Tobias Leich The constructor creates a new surface with the specified parameter values. THIS WILL SEGFAULT!!! Read: http://sdlperl.ath.cx/projects/SDLPerl/ticket/53 my $surface = SDL::Surface->new_from( $old_surface, ... );
+
+
+
-Construtor Parameters
diff --git a/pages/SDL.html-inc b/pages/SDL.html-inc
index 530e24c..87fbc70 100644
--- a/pages/SDL.html-inc
+++ b/pages/SDL.html-inc
@@ -32,10 +32,11 @@
@@ -298,8 +299,25 @@ than the specified depending on the underlying OS.
+ + + SDL:: to improve + SDL::Video add examples, need general improvement. + Event.pod need to be checked against Events.pod + SDL::Events need to be completed + SDL::Cdrom need some examples. + SDL::MultiThread to be created( once implemented ). + SDL::Time to be completed. + SDL::RW to be created. + SDL::Mouse need to be created. + SDL::Joystick need to be created. + SDL::Audio need to be created. - +
SDL::Time - a SDL perl extension for managing timers.
+ + + + + +Returns the number of milliseconds since SDL library initialization. This value wraps around if the program runs for more than 49.7 days
+ + + + + +This function waits a specified number of milliseconds before returning. It waits at least the specified time, but possible longer due to OS scheduling. The delay granularity is at least 10 ms. Some platforms have shorter clock ticks but this is the most common. +SDL::delay doesn't returns anything.
+ +Adds a callback function to be run after the specified number of milliseconds has elapsed. +The callback function is passed the current timer interval and the user supplied parameter from the SDL::add_timer call and returns the next timer interval. +If the returned value from the callback is the same as the one passed in, the timer continues at the same rate. +If the returned value from the callback is 0, the timer is cancelled.
+Another way to cancel a currently-running timer is by calling SDL::remove_timer with the timer's ID (which was returned from SDL::add_timer).
+The timer callback function may run in a different thread than your main program, and so shouldn't call any functions from within itself. +However, you may always call SDL::push_event.
+SDL::add_timer returns the identifier value of the generated timer or undef on error.
+Note : If you use this function, you need to pass SDL_INIT_TIMER to SDL::init.
+ +interval [in] The desired interval of the timer, in milliseconds. + The granularity of the timer is platform-dependent, but you should count on it being at least 10 ms as this is the most common number. + This means that if you request a 16 ms timer, your callback will run approximately 20 ms later on an unloaded system. + If you wanted to set a flag signaling a frame update at 30 frames per second (every 33 ms), you might set a timer for 30 ms (see example below). + + callback [in] The SDL timer callback function which is called when the specified interval elapses. + + param [in] The user parameter which is passed to the callback function + + + + ++ +
Removes a timer callback previously added with SDL::add_timer. +It returns 0 on succés or -1 on error.
+ +Set a callback to run after the specified number of milliseconds has elapsed. +The callback function is passed the current timer interval and returns the next timer interval. +If the returned value is the same as the one passed in, the periodic alarm continues, otherwise a new alarm is scheduled.
+To cancel a currently running timer, call SDL::set_timer(0, NULL);
+The timer callback function may run in a different thread than your main constant, and so shouldn't call any functions from within itself.
+The maximum resolution of this timer is 10 ms, which means that if you request a 16 ms timer, your callback will run approximately 20 ms later on an unloaded system. If you wanted to set a flag signaling a frame update at 30 frames per second (every 33 ms), you might set a timer for 30 ms (see example below).
+If you use this function, you need to pass SDL_INIT_TIMER to SDL::init(). +Note: This function is kept for compatibility but has been superseded by the new timer functions SDL::add_timer and SDL::remove_timer which support multiple timers.
+ + + + + +