1SDL::GFX::Framerate(3)User Contributed Perl DocumentationSDL::GFX::Framerate(3)
2
3
4
6 SDL::GFX::Framerate - framerate calculating functions
7
9 GFX
10
12 The framerate functions are used to insert delays into the graphics
13 loop to maintain a constant framerate.
14
16 init
17 use SDL;
18 use SDL::GFX::Framerate;
19 use SDL::GFX::FPSManager;
20
21 my $fps = SDL::GFX::FPSManager->new(0, 0, 0, 0);
22
23 SDL::GFX::Framerate::init($fps);
24
25 Initialize the framerate manager, set default framerate of 30Hz and
26 reset delay interpolation.
27
28 set
29 SDL::GFX::Framerate::set($fps, 60);
30
31 Sets the new desired framerate to 60 frames per second.
32
33 get
34 my $rate = SDL::GFX::Framerate::get($fps);
35
36 Get the currently set framerate of the manager.
37
38 delay
39 SDL::GFX::Framerate::delay($fps);
40
41 Generate a delay to accommodate the currently set framerate. Call once
42 in the graphics/rendering loop. If the computer cannot keep up with
43 the rate (i.e. drawing too slow), the delay is zero and the delay
44 interpolation is reset.
45
47 See "AUTHORS" in SDL.
48
49
50
51perl v5.30.0 2019-07-26 SDL::GFX::Framerate(3)