|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.matthiasmann.textureloader.Texture
public final class Texture
A texture class. All methods need to be called from the GL thread.
| Nested Class Summary | |
|---|---|
static class |
Texture.Format
|
| Constructor Summary | |
|---|---|
Texture(int width,
int height,
Texture.Format format)
Creates an unmanaged texture |
|
| Method Summary | |
|---|---|
void |
bind()
Binds the texture for rendering. |
void |
delete()
Deletes this texture. |
Texture.Format |
getFormat()
Returns the format used to upload texture data of an unmanaged texture. |
int |
getHeight()
Retrieves the height of an unmanaged texture. |
int |
getWidth()
Retrieves the width of an unmanaged texture. |
boolean |
isDeleted()
Returns true when the texture has been deleted |
boolean |
isManaged()
Returns true if this texture object was created via TextureManager.getTexture(java.net.URL) |
static Texture |
loadTexture(java.net.URL url)
Loads an unmanaged texture synchronously |
void |
upload(int x,
int y,
int width,
int height,
java.nio.ByteBuffer bb)
Uploads texture data. |
void |
upload(int x,
int y,
int width,
int height,
java.nio.IntBuffer ib)
Uploads texture data. |
void |
upload(int x,
int y,
int width,
int height,
TextureBuffer buf)
Uploads texture data. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Texture(int width,
int height,
Texture.Format format)
width - the widthheight - the heightformat - the format of the image data| Method Detail |
|---|
public static Texture loadTexture(java.net.URL url)
throws java.io.IOException
url - the URL to load
java.io.IOException - if an IO or decode error happendpublic boolean isManaged()
TextureManager.getTexture(java.net.URL)
public int getWidth()
public int getHeight()
public Texture.Format getFormat()
public boolean isDeleted()
delete()
public void upload(int x,
int y,
int width,
int height,
java.nio.ByteBuffer bb)
x - the horizontal start of the area to modifyy - the vertical start of the area to modifywidth - the width of the area to modifyheight - the height of the area to modifybb - the direct ByteBuffer containing the texture data - interpreted as unsigned bytes
java.lang.IllegalStateException - when this texture has already been deleted
java.lang.UnsupportedOperationException - when this texture is managedisManaged()
public void upload(int x,
int y,
int width,
int height,
java.nio.IntBuffer ib)
x - the horizontal start of the area to modifyy - the vertical start of the area to modifywidth - the width of the area to modifyheight - the height of the area to modifyib - the direct IntBuffer containing the texture data - interpreted as unsigned bytes
java.lang.IllegalStateException - when this texture has already been deleted
java.lang.UnsupportedOperationException - when this texture is managedisManaged()
public void upload(int x,
int y,
int width,
int height,
TextureBuffer buf)
x - the horizontal start of the area to modifyy - the vertical start of the area to modifywidth - the width of the area to modifyheight - the height of the area to modifybuf - the TextureBuffer containing the texture data - interpreted as unsigned bytes
java.lang.IllegalStateException - when this texture has already been deleted
java.lang.UnsupportedOperationException - when this texture is managedisManaged()public void delete()
java.lang.IllegalStateException - when this texture has already been deleted
java.lang.UnsupportedOperationException - when this texture is managedpublic void bind()
java.lang.IllegalStateException - when this texture has already been deleted
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||