|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.lee.mugen.core.renderer.lwjgl.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()
Create a new texture loader based on the game panel |
Method Summary | |
---|---|
protected java.nio.IntBuffer |
createIntBuffer(int size)
Creates an integer buffer to hold specified ints - strictly a utility method |
Texture |
createTexture(int width,
int height)
|
void |
free(Texture texture)
|
Texture |
getTexture(java.awt.image.BufferedImage img)
Load a texture |
Texture |
getTexture(java.awt.image.BufferedImage img,
int target,
int dstPixelFormat,
int minFilter,
int magFilter)
Load a texture into OpenGL from a image reference on disk. |
Texture |
getTexture(int detpth,
int width,
int height,
int texWidth,
int texHeight,
java.nio.ByteBuffer byteBuffer,
int filter,
int dstPixelFormat)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextureLoader()
gl
- The GL content in which the textures should be loadedMethod Detail |
---|
public Texture getTexture(java.awt.image.BufferedImage img) 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.awt.image.BufferedImage img, 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 resourceprotected java.nio.IntBuffer createIntBuffer(int size)
size
- how many int to contain
public Texture createTexture(int width, int height) throws java.io.IOException
java.io.IOException
public Texture getTexture(int detpth, int width, int height, int texWidth, int texHeight, java.nio.ByteBuffer byteBuffer, int filter, int dstPixelFormat) throws java.io.IOException
java.io.IOException
public void free(Texture texture)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |