public final class GameLoop extends UpdateLoop implements IGameLoop
IUpdateable.update()
,
Game.loop()
Modifier and Type | Field and Description |
---|---|
static int |
TICK_DELTATIME_LAG
The tick
UpdateLoop.getDeltaTime() at which we consider the game not to run fluently anymore. |
Modifier | Constructor and Description |
---|---|
protected |
GameLoop(java.lang.String name,
int updateRate) |
Modifier and Type | Method and Description |
---|---|
protected long |
getExpectedDelta() |
float |
getTimeScale() |
int |
getUpdateRate() |
int |
perform(int delay,
java.lang.Runnable action) |
protected void |
process()
In addition to the normal base implementation, the
GameLoop performs registered action at the required
time and tracks some detailed metrics. |
void |
setTimeScale(float timeScale) |
void |
updateExecutionTime(int index,
long ticks) |
attach, close, delay, detach, getDeltaTime, getProcessTime, getTickRate, getTicks, getUpdatables, run, setTickRate, terminate, update
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
attach, detach, getDeltaTime, getProcessTime, getTickRate, getTicks
start, terminate
public static final int TICK_DELTATIME_LAG
UpdateLoop.getDeltaTime()
at which we consider the game not to run fluently anymore.
public int perform(int delay, java.lang.Runnable action)
public float getTimeScale()
getTimeScale
in interface IGameLoop
public int getUpdateRate()
getUpdateRate
in interface IGameLoop
public void setTimeScale(float timeScale)
setTimeScale
in interface IGameLoop
public void updateExecutionTime(int index, long ticks)
updateExecutionTime
in interface IGameLoop
protected void process()
GameLoop
performs registered action at the required
time and tracks some detailed metrics.process
in class UpdateLoop
protected long getExpectedDelta()
getExpectedDelta
in class UpdateLoop