|
GTGE API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.golden.gamedev.engine.timer.FPSCounter
public class FPSCounter
A utility class to calculate timer frame per seconds (FPS) in convenient way.
How to use :
FPSCounter counter;
// game loop
while (true) {
counter.getCurrentFPS(); // returns current fps
counter.calculateFPS(); // calculating fps
}
| Constructor Summary | |
|---|---|
FPSCounter()
Creates new FPSCounter. |
|
| Method Summary | |
|---|---|
void |
calculateFPS()
The main method that calculating the frame per second. |
int |
getCurrentFPS()
Returns current FPS. |
void |
refresh()
Refresh the FPS counter, reset the fps to 0 and the timer counter to start counting from current time. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FPSCounter()
FPSCounter.
| Method Detail |
|---|
public void refresh()
public void calculateFPS()
public int getCurrentFPS()
calculateFPS()
|
GTGE API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||