/** * This method adds <code>callable</code> to the queue to be invoked in the render() method in the OpenGL thread. * The Future returned may be utilized to cancel the task or wait for the return object. * * @param callable * @return Future<V> */ public <V> Future<V> render(final Callable<V> callable) { return getQueue(GameTaskQueue.RENDER).enqueue(callable); } }
private GameTaskQueueManager() { addQueue(GameTaskQueue.RENDER, new GameTaskQueue()); addQueue(GameTaskQueue.UPDATE, new GameTaskQueue()); }
@Override public String toString() { final String x = "tkey: src:" + _source + " flip: " + _flipped + " code: " + hashCode() + " imageType: " + _format + " id: " + _id; return x; }
@Override public boolean apply(final TwoInputStates arg0) { final double now = timer.getTimeInSeconds(); if (now - lastPass >= throttleTime) { lastPass = now; return true; } return false; } };
/** * Execute the tasks from this queue. Note that depending on the queue type, tasks may expect to be run in a certain * context (for example, the Render queue expects to be run from the Thread owning a GL context.) */ public void execute() { execute(null); }
/** * @param glContext * the object representing the OpenGL context this texture belongs to. See * {@link RenderContext#getGlContextRep()} * @return the texture id of this texture in the given context. If the texture is not found in the given context, 0 * is returned. */ public int getTextureIdForContext(final Object glContext) { return _key.getTextureIdForContext(glContext); }
/** * Update should be called once per frame to correctly update "time per frame" and "frame rate (fps)" */ public void update() { final long time = getTime(); _tpf = (time - _previousTime) * INVERSE_TIMER_RESOLUTION; _fps = 1.0 / _tpf; _previousTime = time; }
/** * Instantiates a new PSSM camera. * * @param width * the width * @param height * the height */ public ExtendedCamera(final int width, final int height) { super(width, height); init(); }
/** * @return the "local time", in seconds reported by our global timer. */ public double getCurrentGlobalTime() { return _globalTimer.getTimeInSeconds(); }
public final long readLong() throws IOException { return ((readByte() & 0xff) | ((long) (readByte() & 0xff) << 8) | ((long) (readByte() & 0xff) << 16) | ((long) (readByte() & 0xff) << 24) | ((long) (readByte() & 0xff) << 32) | ((long) (readByte() & 0xff) << 40) | ((long) (readByte() & 0xff) << 48) | ((long) (readByte() & 0xff) << 56)); }
/** * @return a Set of context objects that currently reference this texture. */ public Set<Object> getContextObjects() { return _idCache.getContextObjects(); }
/** * This method adds <code>callable</code> to the queue to be invoked in the update() method in the OpenGL thread. * The Future returned may be utilized to cancel the task or wait for the return object. * * @param callable * @return Future<V> */ public <V> Future<V> update(final Callable<V> callable) { return getQueue(GameTaskQueue.UPDATE).enqueue(callable); }
private GameTaskQueueManager() { addQueue(GameTaskQueue.RENDER, new GameTaskQueue()); addQueue(GameTaskQueue.UPDATE, new GameTaskQueue()); }
@Override public String toString() { final String x = "tkey: src:" + _source + " flip: " + _flipped + " code: " + hashCode() + " imageType: " + _format + " id: " + _id; return x; }
/** * @param glContext * the object representing the OpenGL context this texture belongs to. See * {@link RenderContext#getGlContextRep()} * @return the texture id of this texture in the given context as an Integer object. If the texture is not found in * the given context, a 0 integer is returned. */ public Integer getTextureIdForContextAsInteger(final Object glContext) { return _key.getTextureIdForContext(glContext); }
/** * Update should be called once per frame to correctly update "time per frame" and "frame rate (fps)" */ public void update() { final long time = getTime(); _tpf = (time - _previousTime) * INVERSE_TIMER_RESOLUTION; _fps = 1.0 / _tpf; _previousTime = time; }
/** * Instantiates a new PSSM camera. * * @param width * the width * @param height * the height */ public ExtendedCamera(final int width, final int height) { super(width, height); init(); }
/** * This method adds <code>callable</code> to the queue to be invoked in the update() method in the OpenGL thread. * The Future returned may be utilized to cancel the task or wait for the return object. * * @param callable * @return Future<V> */ public <V> Future<V> update(final Callable<V> callable) { return getQueue(GameTaskQueue.UPDATE).enqueue(callable); }
/** * @param context * the OpenGL context this texture belongs to. * @return the texture id of this texture in the given context. If the texture is not found in the given context, 0 * is returned. */ public int getTextureIdForContext(final RenderContext context) { return _key.getTextureIdForContext(context); }
/** * This method adds <code>callable</code> to the queue to be invoked in the render() method in the OpenGL thread. * The Future returned may be utilized to cancel the task or wait for the return object. * * @param callable * @return Future<V> */ public <V> Future<V> render(final Callable<V> callable) { return getQueue(GameTaskQueue.RENDER).enqueue(callable); } }