|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaspack.render.TextureLoader
public class TextureLoader
A utility class to load textures for JOGL. This source is based on a texture that can be found in the Java Gaming (www.javagaming.org) Wiki. It has been simplified slightly for explicit 2D graphics use. OpenGL uses a particular image format. Since the images that are loaded from disk may not match this format this loader introduces a intermediate image which the source image is copied into. In turn, this image is used as source for the OpenGL texture.
Constructor Summary | |
---|---|
TextureLoader(javax.media.opengl.GL2 gl)
Create a new texture loader based on the game panel |
Method Summary | |
---|---|
Texture |
getTexture(java.lang.String resourceName)
Load a texture |
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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextureLoader(javax.media.opengl.GL2 gl)
gl
- The GL content in which the textures should be loadedMethod Detail |
---|
public Texture getTexture(java.lang.String resourceName) throws java.io.IOException
resourceName
- The location of the resource to load
java.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 minimising filtermagFilter
- The magnification filter
java.io.IOException
- Indicates a failure to access the resource
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |