|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaspack.render.Texture
public class Texture
A texture to be bound within JOGL. This object is responsible for keeping track of a given OpenGL texture and for calculating the texturing mapping coordinates of the full image. Since textures need to be powers of 2 the actual texture may be considerably bigged that the source image and hence the texture mapping coordinates need to be adjusted to matchup drawing the sprite against the texture.
Constructor Summary | |
---|---|
Texture(int target,
int textureID)
Create a new texture |
Method Summary | |
---|---|
void |
bind(javax.media.opengl.GL2 gl)
Bind the specified GL context to a texture |
float |
getHeight()
Get the height of the physical texture |
int |
getImageHeight()
Get the height of the original image |
int |
getImageWidth()
Get the width of the original image |
float |
getWidth()
Get the width of the physical texture |
void |
setHeight(int height)
Set the height of the image |
void |
setTextureHeight(int texHeight)
Set the height of this texture |
void |
setTextureWidth(int texWidth)
Set the width of this texture |
void |
setWidth(int width)
Set the width of the image |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Texture(int target, int textureID)
target
- The GL targettextureID
- The GL texture IDMethod Detail |
---|
public void bind(javax.media.opengl.GL2 gl)
gl
- The GL context to bind topublic void setHeight(int height)
height
- The height of the imagepublic void setWidth(int width)
width
- The width of the imagepublic int getImageHeight()
public int getImageWidth()
public float getHeight()
public float getWidth()
public void setTextureHeight(int texHeight)
texHeight
- The height of the texturepublic void setTextureWidth(int texWidth)
texWidth
- The width of the texture
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |