/** * 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); }
/** * Clears all tasks from the queues managed by this manager. */ public void clearTasks() { for (final GameTaskQueue q : _managedQueues.values()) { q.clear(); } }
public void moveTasksTo(final GameTaskQueueManager manager) { for (final String key : _managedQueues.keySet()) { final GameTaskQueue q = manager.getQueue(key); final GameTaskQueue mq = _managedQueues.get(key); if (q != null && mq.size() > 0) { q.enqueueAll(mq); } } }
/** * 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()); }
/** * 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()); }
/** * 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); }
public void moveTasksTo(final GameTaskQueueManager manager) { for (final String key : _managedQueues.keySet()) { final GameTaskQueue q = manager.getQueue(key); final GameTaskQueue mq = _managedQueues.get(key); if (q != null && mq.size() > 0) { q.enqueueAll(mq); } } }
/** * 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); }
/** * Clears all tasks from the queues managed by this manager. */ public void clearTasks() { for (final GameTaskQueue q : _managedQueues.values()) { q.clear(); } }
@Override public boolean render(final Renderer renderer) { // Execute renderQueue item GameTaskQueueManager.getManager(ContextManager.getCurrentContext()).getQueue(GameTaskQueue.RENDER) .execute(renderer); // Clean up card garbage such as textures, vbos, etc. ContextGarbageCollector.doRuntimeCleanup(renderer); _root.onDraw(renderer); return true; } }
/** * 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); } }
@Override public boolean render(final Renderer renderer) { if (Constants.stats && labGraph == null) { setupStatGraphs(renderer); setupStats(); } // Execute renderQueue items GameTaskQueueManager.getManager(ParticleEditorFrame.GLOBAL_CONTEXT).getQueue(GameTaskQueue.RENDER) .execute(renderer); // Clean up card garbage such as textures, vbos, etc. ContextGarbageCollector.doRuntimeCleanup(renderer); rootNode.draw(renderer); if (Constants.stats) { StatCollector.update(); statNode.draw(renderer); } return true; }
public void update(final ReadOnlyTimer timer) { final double tpf = timer.getTimePerFrame(); // Execute update queue items GameTaskQueueManager.getManager(ParticleEditorFrame.GLOBAL_CONTEXT).getQueue(GameTaskQueue.UPDATE).execute(); _logicalLayer.checkTriggers(tpf); rootNode.updateGeometricState(tpf); if (Constants.stats) { final Camera cam = Camera.getCurrentCamera(); if (cam != null) { labGraph.setTranslation((cam.getWidth() - .5f * labGraph.getWidth()), (.5f * labGraph.getHeight()), 0); } statNode.updateGeometricState(tpf); } }