Section: User Contributed Perl Documentation (3)
SDL::GFX::Framerate - framerate calculating functions
The framerate functions are used to insert delays into the graphics loop to maintain a constant framerate.
my $fps = SDL::GFX::FPSManager->new(0, 0, 0, 0);
Initialize the framerate manager, set default framerate of 30Hz and reset delay interpolation.
Sets the new desired framerate to 60 frames per second.
my $rate = SDL::GFX::Framerate::get($fps);
Get the currently set framerate of the manager.
Generate a delay to accommodate the 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 zero and the delay interpolation is reset.