X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pages%2FSDL-GFX-Framerate.html-inc;h=59730a1478dd8e20ed7d14c335e84e27aa12da3c;hb=56d4907c407e8564b4a8a9d09e252573131fad3e;hp=f1fabde65c0820942fb7a7956543db3bf076bb98;hpb=c256636b7bb9431b6605429e3f793859c6983842;p=sdlgit%2FSDL-Site.git diff --git a/pages/SDL-GFX-Framerate.html-inc b/pages/SDL-GFX-Framerate.html-inc index f1fabde..59730a1 100644 --- a/pages/SDL-GFX-Framerate.html-inc +++ b/pages/SDL-GFX-Framerate.html-inc @@ -1,12 +1,81 @@

Index

-
+ +
-

The Following are XS bindings to the SDL_gfx Library

-

Described here:

-

See: http://www.ferzkopp.net/joomla/content/view/19/14/

+

NAME

Top

+
+

SDL::GFX::Framerate - framerate calculating functions

+ +
+

CATEGORY

Top

+
+

GFX

+ +
+

DESCRIPTION

Top

+
+

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

+ +
+

METHODS

Top

+
+ +
+

init

+
+
 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.

+ +
+

set

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

Sets the new desired framerate to 60 frames per second.

+ +
+

get

+
+
 my $rate = SDL::GFX::Framerate::get($fps);
+
+
+

Get the currently set framerate of the manager.

+ +
+

delay

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

Generate a delay to accomodate currently set framerate. Call once in thegraphics/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.

+ + + +
\ No newline at end of file