当前位置: 首页>>代码示例>>Java>>正文


Java Texture.destroy方法代码示例

本文整理汇总了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();
		}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:23,代码来源:GridTileLayer.java

示例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();
}
 
开发者ID:vobject,项目名称:maru,代码行数:11,代码来源:TextureCache.java

示例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();
	 }
}
 
开发者ID:johb,项目名称:GAIA,代码行数:54,代码来源:TextureAdapter.java

示例4: deleteTexture

import com.jogamp.opengl.util.texture.Texture; //导入方法依赖的package包/类
public void deleteTexture(final Texture texture) {
	texture.destroy(gl);
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:4,代码来源:OpenGL.java


注:本文中的com.jogamp.opengl.util.texture.Texture.destroy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。