private static void handleVBODelete(final IShaderUtils utils, final Multimap<RenderContextRef, Integer> idMap) { Object currentGLRef = null; // Grab the current context, if any. if (utils != null && ContextManager.getCurrentContext() != null) { currentGLRef = ContextManager.getCurrentContext().getGlContextRef(); } // For each affected context... for (final RenderContextRef glref : idMap.keySet()) { // If we have a deleter and the context is current, immediately delete if (utils != null && glref.equals(currentGLRef)) { utils.deleteBuffers(idMap.get(glref)); } // Otherwise, add a delete request to that context's render task queue. else { GameTaskQueueManager.getManager(ContextManager.getContextForRef(glref)) .render(new RendererCallable<Void>() { public Void call() throws Exception { getRenderer().getShaderUtils().deleteBuffers(idMap.get(glref)); return null; } }); } } }
private static void handleTextureDelete(final Renderer deleter, final Multimap<Object, Integer> idMap, final Map<Object, Future<Void>> futureStore) { Object currentGLRef = null; // Grab the current context, if any. if (deleter != null && ContextManager.getCurrentContext() != null) { currentGLRef = ContextManager.getCurrentContext().getGlContextRep(); } // For each affected context... for (final Object glref : idMap.keySet()) { // If we have a deleter and the context is current, immediately delete if (currentGLRef != null && (!Constants.useMultipleContexts || glref.equals(currentGLRef))) { deleter.deleteTextureIds(idMap.get(glref)); } // Otherwise, add a delete request to that context's render task queue. else { final Future<Void> future = GameTaskQueueManager.getManager(ContextManager.getContextForRef(glref)) .render(new RendererCallable<Void>() { public Void call() throws Exception { getRenderer().deleteTextureIds(idMap.get(glref)); return null; } }); if (futureStore != null) { futureStore.put(glref, future); } } } }
private static void handleTextureDelete(final ITextureUtils utils, final Multimap<RenderContextRef, Integer> idMap, final Map<RenderContextRef, Future<Void>> futureStore) { RenderContextRef currentGLRef = null; // Grab the current context, if any. if (utils != null && ContextManager.getCurrentContext() != null) { currentGLRef = ContextManager.getCurrentContext().getGlContextRef(); } // For each affected context... for (final RenderContextRef contextRef : idMap.keySet()) { // If we have a deleter and the context is current, immediately delete if (currentGLRef != null && (!Constants.useMultipleContexts || contextRef.equals(currentGLRef))) { utils.deleteTextureIds(idMap.get(contextRef)); } // Otherwise, add a delete request to that context's render task queue. else { final Future<Void> future = GameTaskQueueManager.getManager(ContextManager.getContextForRef(contextRef)) .render(new RendererCallable<Void>() { public Void call() throws Exception { getRenderer().getTextureUtils().deleteTextureIds(idMap.get(contextRef)); return null; } }); if (futureStore != null) { futureStore.put(contextRef, future); } } } }
private static void handleVBODelete(final Renderer deleter, final Multimap<Object, Integer> idMap) { Object currentGLRef = null; // Grab the current context, if any. if (deleter != null && ContextManager.getCurrentContext() != null) { currentGLRef = ContextManager.getCurrentContext().getGlContextRep(); } // For each affected context... for (final Object glref : idMap.keySet()) { // If we have a deleter and the context is current, immediately delete if (deleter != null && glref.equals(currentGLRef)) { deleter.deleteVBOs(idMap.get(glref)); } // Otherwise, add a delete request to that context's render task queue. else { GameTaskQueueManager.getManager(ContextManager.getContextForRef(glref)).render( new RendererCallable<Void>() { public Void call() throws Exception { getRenderer().deleteVBOs(idMap.get(glref)); return null; } }); } } }
private static void handleVAODelete(final IShaderUtils utils, final Multimap<RenderContextRef, Integer> idMap) { RenderContextRef currentGLRef = null; // Grab the current context, if any. if (utils != null && ContextManager.getCurrentContext() != null) { currentGLRef = ContextManager.getCurrentContext().getGlContextRef(); } // For each affected context... for (final RenderContextRef ref : idMap.keySet()) { // If we have a deleter and the context is current, immediately delete if (utils != null && ref.equals(currentGLRef)) { utils.deleteVertexArrays(idMap.get(ref)); } // Otherwise, add a delete request to that context's render task queue. else { GameTaskQueueManager.getManager(ContextManager.getContextForRef(ref)) .render(new RendererCallable<Void>() { public Void call() throws Exception { getRenderer().getShaderUtils().deleteVertexArrays(idMap.get(ref)); return null; } }); } } }
private static void handleDisplayListDelete(final Renderer deleter, final Multimap<Object, Integer> idMap) { Object currentGLRef = null; // Grab the current context, if any. if (deleter != null && ContextManager.getCurrentContext() != null) { currentGLRef = ContextManager.getCurrentContext().getGlContextRep(); } // For each affected context... for (final Object glref : idMap.keySet()) { // If we have a deleter and the context is current, immediately delete if (deleter != null && glref.equals(currentGLRef)) { deleter.deleteDisplayLists(idMap.get(glref)); } // Otherwise, add a delete request to that context's render task queue. else { GameTaskQueueManager.getManager(ContextManager.getContextForRef(glref)).render( new RendererCallable<Void>() { public Void call() throws Exception { getRenderer().deleteDisplayLists(idMap.get(glref)); return null; } }); } } } }