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.