org.gljava.opengl
public class TextureFactory extends Object
Version: $Id: TextureFactory.java,v 1.2 2005/02/02 19:22:28 ivan_ganza Exp $
| Field Summary | |
|---|---|
| ColorModel | glAlphaColorModel
Colour model including alpha for the GL image
|
| ColorModel | glColorModel
colour model for the GL image
|
| static TextureFactory | instance
Factory instance
|
| HashMap | textureCache
Cache of loaded Textures
|
| IntBuffer | textureIDBuffer
buffer for texture ID's
|
| Constructor Summary | |
|---|---|
| TextureFactory()
Creates a new TextureFactory instance.
| |
| Method Summary | |
|---|---|
| ByteBuffer | convertImageData(BufferedImage bufferedImage, Texture texture)
Convert the buffered image to byte buffer with the data in appropriate format
to pass to opengl
|
| int | createTextureID(GL gl)
Create a new texture ID
|
| int | getClosestGreaterPowerOf2(int target)
Get the closest greater power of 2
|
| static TextureFactory | getFactory()
initialization
|
| BufferedImage | loadImage(String path)
Describe loadImage method here.
|
| BufferedImage | loadImage(URL url)
Describe loadImage method here.
|
| BufferedImage | loadImageResource(String resourceName)
Describe loadImageResource method here.
|
| Texture | loadSubTexture2D(GL gl, String path, int xOffset, int yOffset, int width, int height) |
| Texture | loadSubTexture2D(GL gl, BufferedImage bufferedImage, int target, int dstPixelFormat, int minFilter, int magFilter, int xOffset, int yOffset, int width, int height)
Describe loadSubTexture method here.
|
| Texture | loadTexture(GL gl, String path)
Load a Texture from the filesystem
|
| Texture | loadTexture(GL gl, URL url)
Load a Texture from the given URL
|
| Texture | loadTexture(GL gl, BufferedImage bufferedImage, int target, int dstPixelFormat, int minFilter, int magFilter)
Describe loadTexture method here.
|
| Texture | loadTextureResource(GL gl, String resourceName)
Load a Texture as a resource with the given name
|
| Texture | loadTextureResource(GL gl, String resourceName, int target, int dstPixelFormat, int minFilter, int magFilter)
Load a Texture as a resource with the given name
|
TextureFactory instance.
Parameters: bufferedImage The image to convert to a texture texture The texture to store the data into
Returns: A buffer containing the data
Returns: A new texture ID
Parameters: target The target number
Returns: The power of 2
loadImage method here.
Parameters: path a String value
Returns: a BufferedImage value
Throws: IOException if an error occurs
loadImage method here.
Parameters: url an URL value
Returns: a BufferedImage value
Throws: IOException if an error occurs
loadImageResource method here.
Parameters: url an URL value
Returns: a BufferedImage value
Throws: IOException if an error occurs
loadSubTexture method here.
Parameters: gl a GL value bufferedImage a BufferedImage value target an int value dstPixelFormat an int value minFilter an int value magFilter an int value width an int value height an int value
Returns: a Texture value
Throws: IOException if an error occurs
Parameters: gl a GL value path The path on the filesystem to the Texture
Returns: a Texture value
Throws: IOException if an error occurs
Parameters: gl a GL value url an URL value
Returns: a Texture value
Throws: IOException if an error occurs
loadTexture method here.
Parameters: gl a GL value image a BufferedImage value target an int value dstPixelFormat an int value minFilter an int value magFilter an int value
Returns: a Texture value
Throws: IOException if an error occurs
Parameters: gl a GL value resourceName a String value
Returns: a Texture value
Throws: IOException if an error occurs
Parameters: gl a GL value resourceName a String value target an int value dstPixelFormat an int value minFilter an int value magFilter an int value
Returns: a Texture value
Throws: IOException if an error occurs