3 <h3 id="TOP">Index</h3>
5 <ul><li><a href="#NAME">NAME</a></li>
6 <li><a href="#CATEGORY">CATEGORY</a></li>
7 <li><a href="#DESCRIPTION">DESCRIPTION</a></li>
8 <li><a href="#METHODS">METHODS</a>
9 <ul><li><a href="#init">init</a></li>
10 <li><a href="#set">set</a></li>
11 <li><a href="#get">get</a></li>
12 <li><a href="#delay">delay</a></li>
15 <li><a href="#AUTHORS">AUTHORS</a>
20 <h1 id="NAME">NAME</h1><p><a href="#TOP" class="toplink">Top</a></p>
21 <div id="NAME_CONTENT">
22 <p>SDL::GFX::Framerate - framerate calculating functions</p>
25 <h1 id="CATEGORY">CATEGORY</h1><p><a href="#TOP" class="toplink">Top</a></p>
26 <div id="CATEGORY_CONTENT">
30 <h1 id="DESCRIPTION">DESCRIPTION</h1><p><a href="#TOP" class="toplink">Top</a></p>
31 <div id="DESCRIPTION_CONTENT">
32 <p>The framerate functions are used to insert delays into the graphics loop to maintain a constant framerate.</p>
35 <h1 id="METHODS">METHODS</h1><p><a href="#TOP" class="toplink">Top</a></p>
36 <div id="METHODS_CONTENT">
39 <h2 id="init">init</h2>
40 <div id="init_CONTENT">
42 use SDL::GFX::Framerate;
43 use SDL::GFX::FPSManager;
45 my $fps = SDL::GFX::FPSManager->new(0, 0, 0, 0);
47 SDL::GFX::Framerate::init($fps);
50 <p>Initialize the framerate manager, set default framerate of 30Hz and reset delay interpolation.</p>
54 <div id="set_CONTENT">
55 <pre> SDL::GFX::Framerate::set($fps, 60);
58 <p>Sets the new desired framerate to 60 frames per second.</p>
62 <div id="get_CONTENT">
63 <pre> my $rate = SDL::GFX::Framerate::get($fps);
66 <p>Get the currently set framerate of the manager.</p>
69 <h2 id="delay">delay</h2>
70 <div id="delay_CONTENT">
71 <pre> SDL::GFX::Framerate::delay($fps);
74 <p>Generate a delay to accomodate currently set framerate. Call once in thegraphics/rendering loop.
75 If the computer cannot keep up with the rate (i.e.drawing too slow), the delay is zero and the delay interpolation is reset.</p>
78 <h1 id="AUTHORS">AUTHORS</h1><p><a href="#TOP" class="toplink">Top</a></p>
79 <div id="AUTHORS_CONTENT">
80 <p>See <a href="/SDL.html#AUTHORS">/SDL.html#AUTHORS</a>.</p>