SDLx::FPS(3pm) User Contributed Perl Documentation SDLx::FPS(3pm)NAME
SDLx::FPS - a more convenient way to set a framerate
SYNOPSIS
use SDLx::FPS;
my $fps = SDLx::FPS->new(fps => 60);
while(1) { # Main game loop
# Do game related stuff
$fps->delay;
}
DESCRIPTION
SDLx::FPS simplifies the task of giving your game a framerate. Basically, it combines the methods of "SDL::GFX::Framerate" and
"SDL::GFX::FPSManager" into a single module. Use it to delay the main loop to keep it at a specified framerate.
METHODS
new
my $fps = SDLx::FPS->new( fps => 30 );
No arguments are required, if no "fps" is specified, the default FPS is 30.
set
$fps->set($new_framerate);
Same as "SDL::GFX::Framerate::set". Set the new desired framerate.
get
Same as "SDL::GFX::Framerate::get". Get the currently set framerate.
delay
Same as "SDL::GFX::Framerate::delay". Generate a delay to accommodate currently set framerate. Call once in the graphics/rendering loop.
If the computer cannot keep up with the rate (i.e. drawing too slow), the delay is 0 and the delay interpolation is reset.
framecount
Return the "framecount".
rateticks
Return the "rateticks".
lastticks
Return the "lastticks".
rate
Return the "rate".
AUTHORS
See "AUTHORS" in SDL.
SEE ALSO
SDL::GFX::Framerate, SDL::GFX::FPSManager
perl v5.14.2 2012-05-28 SDLx::FPS(3pm)
Check Out this Related Man Page
pods::SDL::Deprecated(3pm) User Contributed Perl Documentation pods::SDL::Deprecated(3pm)NAME
SDL::Deprecated - Log of Deprecated items per release
CATEGORY
Core
RELEASES
2.517
Major changes to "SDLx::Controller".
"quit" is now "stop". Event handlers no longer end "run" on returning false. Call "stop" explicitly instead.
The first argument to move handlers is the step portion instead of "dt". The second argument to move handlers, the "t" value, is now the
third argument.
"min_t" will limit apps to a framerate of 60 by default.
2.513
SDLx::App
"SDLx::App::loop()" is deprecated.
2.502
SDLx::App
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.
SDLx::Sprite::Animated
Has drastically changed, and is still volatile.
2.500
SDL::App
SDL::App has migrated to SDLx::App namespace. The reason for this is because it is an extension and not a 1:1 XS/Constant Module to the
c library.
SDL::Game::Rect
SDL::Game::Rect has migrated to SDLx::Rect namespace. Same reasoning as above.
AUTHORS
See "AUTHORS" in SDL.
perl v5.14.2 2012-05-28 pods::SDL::Deprecated(3pm)
Dear all,
if we want to run a command every 5 mins to check if the process is working fine or not...
like in c, we can use a simple while loop with a delay for 5 mins...
how can we accomplish this is solaris 8/9
thanks
br/asad (5 Replies)
Hi,
I am working on SDL open-source API's on Debian Linux for my game development project. I am not sure whether posting SDL related queries here is correct. I would like to know what is the difference between:
SDL_SetVideoMode() and SDL_VideoModeOK() functions (0 Replies)
Hi All
I have this csv file and I need to calculate the average of FPS.
FPS:27.7420, Interval:1314184238772
FPS:25.9798, Interval:1314184242646
FPS:27.4772, Interval:1314184246311
FPS:26.1623, Interval:1314184250159
FPS:26.4515, Interval:1314184253972
FPS:31.5896, Interval:1314184257163... (24 Replies)