com.golden.gamedev.engine
Interface BaseTimer

All Known Implementing Classes:
GageTimer, LoraxTimer, SystemTimer, SystemTimer3

public interface BaseTimer

Interface for running timer constantly, with specified frame per second.


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.
 

Method Detail

startTimer

public void startTimer(int fps)
Starts the timer with fps frame per second.

Parameters:
fps - the timer frame per second.
See Also:
getCurrentFPS(), getRequestedFPS()

stopTimer

public void stopTimer()
Stops the timer.


sleep

public void sleep()

isRunning

public boolean isRunning()
Returns true if the timer is currently running (startTimer(int) has been called).


getCurrentFPS

public int getCurrentFPS()
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.

Returns:
current frame per second
See Also:
getRequestedFPS()

getRequestedFPS

public int getRequestedFPS()
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().

Returns:
requested frame per second
See Also:
getCurrentFPS(), startTimer(int)