org.jrabbit.standard.game.loop
Class GameLoopProfiler.Default

java.lang.Object
  extended by org.jrabbit.standard.profiler.ProfilerDisplay
      extended by org.jrabbit.standard.game.loop.GameLoopProfiler
          extended by org.jrabbit.standard.game.loop.GameLoopProfiler.Default
All Implemented Interfaces:
Renderable, Updateable, GLTransform, Colored, GLGroupTransformed, Visible
Enclosing class:
GameLoopProfiler

public static class GameLoopProfiler.Default
extends GameLoopProfiler

GameLoopProfiler.Default provides a default implementation. GameLoops automatically use this unless otherwise specified.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jrabbit.standard.game.loop.GameLoopProfiler
GameLoopProfiler.Default
 
Field Summary
protected  ValueTracker<java.lang.Integer> fontCounter
          Keeps track of how many fonts have been loaded.
protected  Counter fps
          This keeps track of the frames per second.
protected  Timer free
          This keeps track of how much free time per cycle the game has.
protected  ValueTracker<java.lang.Integer> imageCounter
          Keeps track of how many Images have been loaded.
protected  Timer logic
          This keeps track of how long updating the game takes.
protected  Timer rendering
          This keeps track of how long rendering the game takes.
protected  ValueTracker<java.lang.Integer> soundCounter
          Keeps track of how many sounds have been loaded.
protected  SystemInfo system
          This displays general info about the system the game is running on.
 
Fields inherited from class org.jrabbit.standard.profiler.ProfilerDisplay
buffer, color, contents, renderer, transforms, visible
 
Constructor Summary
GameLoopProfiler.Default()
          Creates the default GameLoopProfiler.
 
Method Summary
 void advanceFPS()
          Signals that the game has completed a cycle.
 void beginLogic()
          Signals that the game is going to update its logic.
 void beginRender()
          Signals that the game is beginning a render.
 void beginSleep()
          Signals that the game is beginning its sleep phase, in order to keep a steady frame rate and conserve system resources.
 void endLogic()
          Signals that the game has finished all purely logic-based calls.
 void endRender()
          Signals that the game has finished rendering.
 void endSleep()
          Signals that the game has finished sleeping.
 void update(int delta)
          Updates all necessary ProfilerEntities.
 
Methods inherited from class org.jrabbit.standard.profiler.ProfilerDisplay
bind, buffer, color, contents, release, render, renderer, setAllVisible, setRenderer, setVisible, setVisibleFor, setVisibleForAllExcept, transforms, visible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fps

protected Counter fps
This keeps track of the frames per second.


logic

protected Timer logic
This keeps track of how long updating the game takes.


rendering

protected Timer rendering
This keeps track of how long rendering the game takes.


free

protected Timer free
This keeps track of how much free time per cycle the game has.


imageCounter

protected ValueTracker<java.lang.Integer> imageCounter
Keeps track of how many Images have been loaded.


fontCounter

protected ValueTracker<java.lang.Integer> fontCounter
Keeps track of how many fonts have been loaded.


soundCounter

protected ValueTracker<java.lang.Integer> soundCounter
Keeps track of how many sounds have been loaded. This does not include music.


system

protected SystemInfo system
This displays general info about the system the game is running on.

Constructor Detail

GameLoopProfiler.Default

public GameLoopProfiler.Default()
Creates the default GameLoopProfiler.

Method Detail

update

public void update(int delta)
Updates all necessary ProfilerEntities.

Parameters:
delta - The number of clock ticks that have passed.

advanceFPS

public void advanceFPS()
Signals that the game has completed a cycle.

Specified by:
advanceFPS in class GameLoopProfiler

beginLogic

public void beginLogic()
Signals that the game is going to update its logic.

Specified by:
beginLogic in class GameLoopProfiler

endLogic

public void endLogic()
Signals that the game has finished all purely logic-based calls.

Specified by:
endLogic in class GameLoopProfiler

beginRender

public void beginRender()
Signals that the game is beginning a render.

Specified by:
beginRender in class GameLoopProfiler

endRender

public void endRender()
Signals that the game has finished rendering.

Specified by:
endRender in class GameLoopProfiler

beginSleep

public void beginSleep()
Signals that the game is beginning its sleep phase, in order to keep a steady frame rate and conserve system resources.

Specified by:
beginSleep in class GameLoopProfiler

endSleep

public void endSleep()
Signals that the game has finished sleeping.

Specified by:
endSleep in class GameLoopProfiler