/** * Removes any vbo id from this buffer's data for the given OpenGL context. * * @param glContext * the object representing the OpenGL context a vbo would belong to. See * {@link RenderContext#getGlContextRep()} * @return the id removed or 0 if not found. */ public int removeVBOID(final Object glContext) { if (_vboIdCache != null) { return _vboIdCache.removeValue(glContext); } else { return 0; } }
/** * <p> * Removes any texture id for this texture for the given OpenGL context. * </p> * <p> * Note: This does not remove the texture from the card and is provided for use by code that does remove textures * from the card. * </p> * * @param glContext * the object representing the OpenGL context this texture belongs to. See * {@link RenderContext#getGlContextRep()} */ public void removeFromIdCache(final Object glContext) { _idCache.removeValue(glContext); }
public static void cleanAllVBOs(final Renderer deleter, final RenderContext context) { final Multimap<Object, Integer> idMap = ArrayListMultimap.create(); // gather up expired vbos... these don't exist in our cache gatherGCdIds(idMap); final Object glRep = context.getGlContextRep(); // Walk through the cached items and delete those too. for (final AbstractBufferData<?> buf : _identityCache.keySet()) { // only worry about buffers that have received ids. if (buf._vboIdCache != null) { final Integer id = buf._vboIdCache.removeValue(glRep); if (id != null && id.intValue() != 0) { idMap.put(context.getGlContextRep(), id); } } } handleVBODelete(deleter, idMap); }