public void internalCreate() { timer = new LwjglTimer(); synchronized (createdLock) { created.set(true); createdLock.notifyAll(); } if (renderable.get()) { initContextFirstTime(); } else { assert getType() == Type.Canvas; } }
/** * <code>toString</code> returns the string representation of this timer * in the format: <br> * <br> * jme.utility.Timer@1db699b <br> * Time: {LONG} <br> * FPS: {LONG} <br> * * @return the string representation of this object. */ @Override public String toString() { String string = super.toString(); string += "\nTime: " + oldTime; string += "\nFPS: " + getFrameRate(); return string; } }
@Override public float getTimeInSeconds() { return getTime() * INV_LWJGL_TIMER_RES; }
/** * Constructor builds a <code>Timer</code> object. All values will be * initialized to its default values. */ public LwjglTimer() { reset(); logger.log(Level.FINE, "Timer resolution: {0} ticks per second", LWJGL_TIMER_RES); }
/** * Constructor builds a <code>Timer</code> object. All values will be * initialized to it's default values. */ public LwjglTimer() { reset(); logger.log(Level.FINE, "Timer resolution: {0} ticks per second", LWJGL_TIMER_RES); }
/** * <code>update</code> recalulates the frame rate based on the previous * call to update. It is assumed that update is called each frame. */ public void update() { long curTime = getTime(); lastTPF = (curTime - oldTime) * (1.0f / LWJGL_TIMER_RES); lastFPS = 1.0f / lastTPF; oldTime = curTime; }
public void internalCreate(){ timer = new LwjglTimer(); synchronized (createdLock){ created.set(true); createdLock.notifyAll(); } if (renderable.get()){ initContextFirstTime(); }else{ assert getType() == Type.Canvas; } }
/** * <code>toString</code> returns the string representation of this timer * in the format: <br> * <br> * jme.utility.Timer@1db699b <br> * Time: {LONG} <br> * FPS: {LONG} <br> * * @return the string representation of this object. */ @Override public String toString() { String string = super.toString(); string += "\nTime: " + oldTime; string += "\nFPS: " + getFrameRate(); return string; } }
public void reset() { startTime = Sys.getTime(); oldTime = getTime(); }
/** * <code>update</code> recalulates the frame rate based on the previous * call to update. It is assumed that update is called each frame. */ public void update() { long curTime = getTime(); lastTPF = (curTime - oldTime) * (1.0f / LWJGL_TIMER_RES); lastFPS = 1.0f / lastTPF; oldTime = curTime; }
@Override public float getTimeInSeconds() { return getTime() * INV_LWJGL_TIMER_RES; }
public void reset() { startTime = Sys.getTime(); oldTime = getTime(); }