|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.loop.UpdatingThread
public abstract class UpdatingThread
This is the base for any threaded operation. RenderLoop uses it and you can use it in OperationScheduler, etc.
| Nested Class Summary | |
|---|---|
static class |
UpdatingThread.TimingMode
This enum contains constants to control the timing of this thread. |
| Field Summary | |
|---|---|
static int |
PAUSE_NONE
|
static int |
PAUSE_TOTAL
|
| Constructor Summary | |
|---|---|
UpdatingThread()
|
|
UpdatingThread(GameTimeHost gameTimeHost)
|
|
UpdatingThread(long minItTime)
|
|
UpdatingThread(long minItTime,
GameTimeHost gameTimeHost)
|
|
| Method Summary | |
|---|---|
protected void |
begin(boolean startNewThread)
|
void |
end()
|
FPSLimiter |
getFPSLimiter()
|
long |
getGameMicroTime()
|
long |
getGameMilliTime()
|
long |
getGameNanoTime()
|
long |
getGameTime()
|
long |
getIterationsCount()
|
long |
getLastFrameTime()
|
long |
getLastNanoFrameTime()
|
long |
getMinIterationTime()
|
int |
getPauseMode()
|
java.lang.Thread |
getThread()
|
org.jagatoo.util.timing.TimerInterface |
getTimer()
|
UpdatingThread.TimingMode |
getTimingMode()
|
boolean |
isRunning()
|
protected boolean |
isStopping()
|
protected void |
loop()
This method defines the main loop of the Thread. |
protected long |
nextIteration(boolean force)
|
void |
run()
|
void |
setFPSLimiter(FPSLimiter fpsLimiter)
Sets the FPSLimiter capable of limiting the FPS/iteration time. |
protected void |
setMinIterationTime(long minItTime)
Sets the minimum time, an iteration must take. |
void |
setPauseMode(int pauseMode)
Sets the pauseMode. |
void |
setTimer(org.jagatoo.util.timing.TimerInterface timer)
Sets the timer used by the loop. |
void |
setTimingMode(UpdatingThread.TimingMode mode)
Sets the timing mode for the frameTime. |
abstract void |
update(long gameTime,
long frameTime,
UpdatingThread.TimingMode timingMode)
Updates this Updatable object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int PAUSE_NONE
public static final int PAUSE_TOTAL
| Constructor Detail |
|---|
public UpdatingThread(long minItTime,
GameTimeHost gameTimeHost)
public UpdatingThread(long minItTime)
public UpdatingThread(GameTimeHost gameTimeHost)
public UpdatingThread()
| Method Detail |
|---|
public final void setTimer(org.jagatoo.util.timing.TimerInterface timer)
timer - could be an instance of org.xith3d.utility.timing.JavaTimer, e.g.public final org.jagatoo.util.timing.TimerInterface getTimer()
protected final void setMinIterationTime(long minItTime)
minItTime - public final long getMinIterationTime()
public void setFPSLimiter(FPSLimiter fpsLimiter)
fpsLimiter - public final FPSLimiter getFPSLimiter()
public final long getIterationsCount()
public final void setTimingMode(UpdatingThread.TimingMode mode)
setTimingMode in interface GameTimeHostmode - public final UpdatingThread.TimingMode getTimingMode()
getTimingMode in interface GameTimeHostpublic final long getGameNanoTime()
getGameNanoTime in interface GameTimeHostpublic final long getGameMicroTime()
getGameMicroTime in interface GameTimeHostpublic final long getGameMilliTime()
getGameMilliTime in interface GameTimeHostpublic final long getGameTime()
getGameTime in interface GameTimeHostUpdatingThread.TimingMode.GameTimeHost.getTimingMode()public final long getLastNanoFrameTime()
getLastNanoFrameTime in interface GameTimeHostpublic final long getLastFrameTime()
getLastFrameTime in interface GameTimeHostUpdatingThread.TimingMode) the last frame took.public final void setPauseMode(int pauseMode)
pauseMode - PAUSE_NONE,
PAUSE_TOTALpublic final int getPauseMode()
PAUSE_NONE,
PAUSE_TOTAL
public abstract void update(long gameTime,
long frameTime,
UpdatingThread.TimingMode timingMode)
update in interface UpdatablegameTime - the gameTime in MillisecondsframeTime - the frameTime in Milliseconds (needed time for the last frame)timingMode - the TimingMode to use for frameTime.protected long nextIteration(boolean force)
protected final boolean isStopping()
protected void loop()
public void run()
run in interface java.lang.Runnablepublic java.lang.Thread getThread()
public boolean isRunning()
protected void begin(boolean startNewThread)
public void end()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||