本文整理汇总了Java中com.jogamp.opengl.util.texture.Texture.destroy方法的典型用法代码示例。如果您正苦于以下问题:Java Texture.destroy方法的具体用法?Java Texture.destroy怎么用?Java Texture.destroy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jogamp.opengl.util.texture.Texture
的用法示例。
在下文中一共展示了Texture.destroy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: disposeInvalids
import com.jogamp.opengl.util.texture.Texture; //导入方法依赖的package包/类
public void disposeInvalids(DrawContext dc) {
if (invalid.size() == 0) return;
rwl.writeLock().lock();
for (TileKey tile : invalid) {
Texture t = (Texture) dc.getTextureCache().get(tile);
if (t != null)
{
t.destroy(dc.getGL().getGL2());
dc.getTextureCache().remove(tile);
}
//
// TextureTile tt =
// (TextureTile)
// WorldWind.getMemoryCache(TextureTile.class.getName()).getObject(tile);
}
invalid.clear();
rwl.writeLock().unlock();
}
示例2: clear
import com.jogamp.opengl.util.texture.Texture; //导入方法依赖的package包/类
/**
* Clears the texture cache, freeing all loaded textures.
*/
public void clear()
{
for (Texture texture : textures.values()) {
texture.destroy(gl);
}
textures.clear();
}
示例3: performGLCalls
import com.jogamp.opengl.util.texture.Texture; //导入方法依赖的package包/类
/**
* Creates all textures scheduled.
* Also it will check if the amount of textures in the secondary texture-cache
* has exceeded its limit (MAXSIZE_SECONDARY_TEXCACHE) and - if required - destroys
* a certain amount of them using a Least-Recently-Used (LRU) removal-strategy.
* This method must be called by the OpenGL-thread to prevent
* unexpected behavior.
*/
protected void performGLCalls(GL2 gl) {
while(!toBeBound.isEmpty()) {
NamedImage<TextureData> namedTexData = toBeBound.pop();
// Create the texture from the tiles image without auto-generating mipmaps:
Texture texture;
try {
texture = TextureIO.newTexture(namedTexData.getImage());
//System.out.println("Created a texture " + namedTexData.getName());
} catch(GLException e) {
Logger.getInstance().error("Tried to create texture from non-GL context.");
return;
}
NamedImage<Texture> namedTexture = new NamedImage<Texture>(namedTexData.getName(),
texture);
// Add the entry to the primary texture-cache:
primaryTexturesLock.lock();
primaryTextures.add(namedTexture);
primaryTexturesLock.unlock();
// Before removing entries from secondary cache, lock it:
secondaryTexturesLock.lock();
// Check if the secondary texture-cache has exceeded its limit:
if(secondaryTextures.size() >= MAXSIZE_SECONDARY_TEXCACHE) {
System.out.println("Clearing secondary cache!");
// Destroy the first inserted entries:
for(int i = 0; i < DESTROY_COUNT; i++) {
Texture removedTexture = secondaryTextures.get(0).getImage();
removedTexture.destroy(gl);
secondaryTextures.remove(0);
}
System.gc();
}
// Removing entries done. So free the lock:
secondaryTexturesLock.unlock();
}
}
示例4: deleteTexture
import com.jogamp.opengl.util.texture.Texture; //导入方法依赖的package包/类
public void deleteTexture(final Texture texture) {
texture.destroy(gl);
}