SDL::GFX::Framerate(3pm)

SDL::GFX::Framerate3pm

Framerate calculating functions

Category

GFX

Overview

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

Methods

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

Releases

7 releases since Debian 7 (Wheezy); the text changed 6 times.

  1. 7
  2. 8
  3. 9
  4. 10
  5. 11
  6. 12
  7. 13

Authors

See "AUTHORS" in SDL.

From libsdl-perl 2.548-5+b1 in Debian 13 (Trixie). Parsed by carta from the page's man source.