public static void deleteTextureIds(final Collection<Integer> ids) { // ask for the current state record final RenderContext context = ContextManager.getCurrentContext(); final TextureStateRecord record = (TextureStateRecord) context.getStateRecord(StateType.Texture); final IntBuffer idBuffer = BufferUtils.createIntBuffer(ids.size()); idBuffer.clear(); for (final Integer i : ids) { if (i != null) { idBuffer.put(i); record.removeTextureRecord(i); } } idBuffer.flip(); if (idBuffer.remaining() > 0) { GL11.glDeleteTextures(idBuffer); } }
public static void deleteTexture(final Texture texture) { // ask for the current state record final RenderContext context = ContextManager.getCurrentContext(); final TextureStateRecord record = (TextureStateRecord) context.getStateRecord(StateType.Texture); final Integer id = texture.getTextureIdForContextAsInteger(context); if (id.intValue() == 0) { // Not on card... return. return; } final IntBuffer idBuffer = BufferUtils.createIntBuffer(1); idBuffer.clear(); idBuffer.put(id.intValue()); idBuffer.rewind(); GL11C.glDeleteTextures(idBuffer); record.removeTextureRecord(id); texture.removeFromIdCache(context); }
public static void deleteTextureIds(final Collection<Integer> ids) { // ask for the current state record final RenderContext context = ContextManager.getCurrentContext(); final TextureStateRecord record = (TextureStateRecord) context.getStateRecord(StateType.Texture); final IntBuffer idBuffer = BufferUtils.createIntBuffer(ids.size()); idBuffer.clear(); for (final Integer i : ids) { if (i != null) { idBuffer.put(i); record.removeTextureRecord(i); } } idBuffer.flip(); if (idBuffer.remaining() > 0) { GL11C.glDeleteTextures(idBuffer); } }
public static void deleteTexture(final Texture texture) { // ask for the current state record final RenderContext context = ContextManager.getCurrentContext(); final TextureStateRecord record = (TextureStateRecord) context.getStateRecord(StateType.Texture); final Integer id = texture.getTextureIdForContextAsInteger(context.getGlContextRep()); if (id.intValue() == 0) { // Not on card... return. return; } final IntBuffer idBuffer = BufferUtils.createIntBuffer(1); idBuffer.clear(); idBuffer.put(id.intValue()); idBuffer.rewind(); GL11.glDeleteTextures(idBuffer); record.removeTextureRecord(id); texture.removeFromIdCache(context.getGlContextRep()); }
public static void deleteTextureIds(final Collection<Integer> ids) { final GL gl = GLContext.getCurrentGL(); // ask for the current state record final RenderContext context = ContextManager.getCurrentContext(); final TextureStateRecord record = (TextureStateRecord) context.getStateRecord(StateType.Texture); final IntBuffer idBuffer = BufferUtils.createIntBuffer(ids.size()); idBuffer.clear(); for (final Integer i : ids) { if (i != null) { idBuffer.put(i); record.removeTextureRecord(i); } } idBuffer.flip(); if (idBuffer.remaining() > 0) { gl.glDeleteTextures(idBuffer.remaining(), idBuffer); } }
public static void deleteTexture(final Texture texture) { final GL gl = GLContext.getCurrentGL(); // ask for the current state record final RenderContext context = ContextManager.getCurrentContext(); final TextureStateRecord record = (TextureStateRecord) context.getStateRecord(StateType.Texture); final Integer id = texture.getTextureIdForContextAsInteger(context.getGlContextRep()); if (id.intValue() == 0) { // Not on card... return. return; } final IntBuffer idBuffer = BufferUtils.createIntBuffer(1); idBuffer.clear(); idBuffer.put(id.intValue()); idBuffer.rewind(); gl.glDeleteTextures(idBuffer.limit(), idBuffer); record.removeTextureRecord(id); texture.removeFromIdCache(context.getGlContextRep()); }