本文整理匯總了Java中javax.media.opengl.GL.GL_RGBA屬性的典型用法代碼示例。如果您正苦於以下問題:Java GL.GL_RGBA屬性的具體用法?Java GL.GL_RGBA怎麽用?Java GL.GL_RGBA使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類javax.media.opengl.GL
的用法示例。
在下文中一共展示了GL.GL_RGBA屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: retriveTextureTile
public TextureTile retriveTextureTile(DrawContext dc, TextureTile tile) {
// Create the tile bounds from the tile sector
Sector s = tile.getSector();
Rectangle2D tileBounds = new Rectangle2D.Double(s.getMinLongitude().degrees, s.getMinLatitude().degrees,
s.getDeltaLonDegrees(), s.getDeltaLatDegrees());
final URL textureURL =
WorldWind.getDataFileStore().findFile(tile.getPath(), true);
// Tile is in dataFileCache
if (textureURL != null)
{
if (loadTexture(tile, textureURL))
{
return tile;
}
else
{
// Assume that something's wrong with the file and delete it.
WorldWind.getDataFileStore().removeFile(textureURL);
String message = Logging.getMessage("generic.DeletedCorruptDataFile", textureURL);
Logging.logger().info(message);
}
}
BufferedImage img = drawTracksInBounds(tile.getLevelNumber(), tileBounds);
// Try to get this tile from memory
TextureTile tileB = (TextureTile)
WorldWind.getMemoryCache(TextureTile.class.getName())
.getObject(tile.getTileKey());
if (tileB != null)
// A tile has been found, use that
tile = tileB;
else {
// No tile could be found, use this one
WorldWind.getMemoryCache(TextureTile.class.getName())
.add(tile.getTileKey(), tile);
}
GL2 gl = dc.getGL().getGL2(); // GL initialization checks for GL2 compatibility.
// Create a new TextureData from the rendered image of the grid
TextureData td = new AWTTextureData(gl.getGLProfile(),GL.GL_RGBA, GL.GL_RGBA, false, img);
// Set the new tile texture
tile.setTextureData(td);
return tile;
}