com.golden.gamedev.engine.timer
Class GageTimer

java.lang.Object
  |
  +--com.golden.gamedev.engine.timer.GageTimer
All Implemented Interfaces:
BaseTimer

public class GageTimer
extends Object
implements BaseTimer

Timer builds based on GAGE game engine library. To use this timer you must download the GAGE Timer at http://java.dnsalias.com/


Constructor Summary
GageTimer()
          Creates a new instance of GageTimer.
 
Method Summary
 int getCurrentFPS()
          Returns current frame per second.
 int getRequestedFPS()
          Returns requested frame per second.
 boolean isRunning()
          Returns true if the timer is currently running (startTimer(int) has been called).
 void sleep()
           
 void startTimer(int fps)
          Starts the timer with fps frame per second.
 void stopTimer()
          Stops the timer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GageTimer

public GageTimer()
Creates a new instance of GageTimer.

See Also:
startTimer(int)
Method Detail

startTimer

public void startTimer(int fps)
Description copied from interface: BaseTimer
Starts the timer with fps frame per second.

Specified by:
startTimer in interface BaseTimer
Parameters:
fps - the timer frame per second.
See Also:
BaseTimer.getCurrentFPS(), BaseTimer.getRequestedFPS()

stopTimer

public void stopTimer()
Description copied from interface: BaseTimer
Stops the timer.

Specified by:
stopTimer in interface BaseTimer

sleep

public void sleep()
Specified by:
sleep in interface BaseTimer

isRunning

public boolean isRunning()
Description copied from interface: BaseTimer
Returns true if the timer is currently running (BaseTimer.startTimer(int) has been called).

Specified by:
isRunning in interface BaseTimer

getCurrentFPS

public int getCurrentFPS()
Description copied from interface: BaseTimer
Returns current frame per second.
Current frame per second is the actual fps the user machine could achieved.
This may differ from the requested frame per second because of the incapability of the user processor.

Specified by:
getCurrentFPS in interface BaseTimer
Returns:
current frame per second
See Also:
BaseTimer.getRequestedFPS()

getRequestedFPS

public int getRequestedFPS()
Description copied from interface: BaseTimer
Returns requested frame per second.
Requested frame per second is the requested fps by calling startTimer(int) method.
Because of the incapability of the user processor, high requested fps may not always be achieved.
To get the actual fps achieved see getCurrentFPS().

Specified by:
getRequestedFPS in interface BaseTimer
Returns:
requested frame per second
See Also:
BaseTimer.getCurrentFPS(), BaseTimer.startTimer(int)