GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
pods::SDL::GFX::Framerate(3) User Contributed Perl Documentation pods::SDL::GFX::Framerate(3)

SDL::GFX::Framerate - framerate calculating functions

GFX

The framerate functions are used to insert delays into the graphics loop to maintain a constant framerate.

 use SDL;
 use SDL::GFX::Framerate;
 use SDL::GFX::FPSManager;

 my $fps = SDL::GFX::FPSManager->new(0, 0, 0, 0);
 
 SDL::GFX::Framerate::init($fps);

Initialize the framerate manager, set default framerate of 30Hz and reset delay interpolation.

 SDL::GFX::Framerate::set($fps, 60);

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.

 SDL::GFX::Framerate::delay($fps);

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.

See "AUTHORS" in SDL.
2022-06-07 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.