public class TextureLoader
extends java.lang.Object
Constructor and Description |
---|
TextureLoader(javax.media.opengl.GL2 gl)
Create a new texture loader based on the game panel
|
Modifier and Type | Method and Description |
---|---|
void |
clearAllTextures() |
void |
clearTexture(java.lang.String id) |
javax.media.opengl.GL2 |
getGL2() |
Texture |
getTexture(java.lang.String resourceName)
Load a texture
|
Texture |
getTexture(java.lang.String resourceName,
byte[] buffer,
int width,
int height,
int srcPixelFormat,
int dstPixelFormat) |
Texture |
getTexture(java.lang.String name,
byte[] bytes,
int width,
int height,
int srcPixelFormat,
int target,
int dstPixelFormat,
int minFilter,
int magFilter) |
Texture |
getTexture(java.lang.String resourceName,
int target,
int dstPixelFormat,
int minFilter,
int magFilter)
Load a texture into OpenGL from a image reference on disk.
|
Texture |
getTextureByName(java.lang.String name) |
boolean |
isTextureValid(java.lang.String id) |
public TextureLoader(javax.media.opengl.GL2 gl)
gl
- The GL content in which the textures should be loadedpublic Texture getTexture(java.lang.String resourceName) throws java.io.IOException
resourceName
- The location of the resource to loadjava.io.IOException
- Indicates a failure to access the resourcepublic Texture getTexture(java.lang.String resourceName, int target, int dstPixelFormat, int minFilter, int magFilter) throws java.io.IOException
resourceName
- The location of the resource to loadtarget
- The GL target to load the texture againstdstPixelFormat
- The pixel format of the screenminFilter
- The minimizing filtermagFilter
- The magnification filterjava.io.IOException
- Indicates a failure to access the resourcepublic Texture getTexture(java.lang.String resourceName, byte[] buffer, int width, int height, int srcPixelFormat, int dstPixelFormat)
public Texture getTexture(java.lang.String name, byte[] bytes, int width, int height, int srcPixelFormat, int target, int dstPixelFormat, int minFilter, int magFilter)
public javax.media.opengl.GL2 getGL2()
public void clearTexture(java.lang.String id)
public void clearAllTextures()
public Texture getTextureByName(java.lang.String name)
public boolean isTextureValid(java.lang.String id)