sdljavax.gfx

Class FPSmanager

public final class FPSmanager extends Object

Full java version of the framerate manager from SDL_gfx library.

Version: $Id: FPSmanager.java,v 1.1 2005/02/18 02:54:32 doc_alton Exp $

Author: Bart LEBOEUF

Field Summary
intframecount
static intFPS_DEFAULT
static intFPS_LOWER_LIMIT
static intFPS_UPPER_LIMIT
longlastticks
intrate
floatrateticks
Constructor Summary
FPSmanager()
framerate manager
Method Summary
voidframerateDelay()
Delay execution to maintain a constant framerate.
intgetFramerate()
Return the current target framerate in Hz
voidinitFramerate()
Initialize the framerate manager
intsetFramerate(int new_rate)
Set the framerate in Hz

Field Detail

framecount

int framecount

FPS_DEFAULT

public static final int FPS_DEFAULT

FPS_LOWER_LIMIT

public static final int FPS_LOWER_LIMIT

FPS_UPPER_LIMIT

public static final int FPS_UPPER_LIMIT

lastticks

long lastticks

rate

int rate

rateticks

float rateticks

Constructor Detail

FPSmanager

public FPSmanager()
framerate manager

Method Detail

framerateDelay

public void framerateDelay()
Delay execution to maintain a constant framerate. Calculate fps.

getFramerate

public int getFramerate()
Return the current target framerate in Hz

Returns:

initFramerate

public void initFramerate()
Initialize the framerate manager

setFramerate

public int setFramerate(int new_rate)
Set the framerate in Hz