|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.opengl.util.texture.Texture
Represents an OpenGL texture object. Contains convenience routines
for enabling/disabling OpenGL texture state, binding this texture,
and computing texture coordinates for both the entire image as well
as a sub-image.
REMIND: document GL_TEXTURE_2D/GL_TEXTURE_RECTANGLE_ARB issues...
REMIND: translucent images will have premultiplied comps by default...
Method Summary | |
void |
bind()
Binds this texture to the current GL context. |
void |
disable()
Disables this texture's target (e.g., GL_TEXTURE_2D) in the current GL context's state. |
void |
dispose()
Disposes the native resources used by this texture object. |
void |
enable()
Enables this texture's target (e.g., GL_TEXTURE_2D) in the current GL context's state. |
int |
getEstimatedMemorySize()
Returns an estimate of the amount of texture memory in bytes this Texture consumes. |
int |
getHeight()
Returns the height of the texture. |
int |
getImageHeight()
Returns the height of the image contained within this texture. |
TextureCoords |
getImageTexCoords()
Returns the set of texture coordinates corresponding to the entire image. |
int |
getImageWidth()
Returns the width of the image contained within this texture. |
boolean |
getMustFlipVertically()
Indicates whether this texture's texture coordinates must be flipped vertically in order to properly display the texture. |
TextureCoords |
getSubImageTexCoords(int x1,
int y1,
int x2,
int y2)
Returns the set of texture coordinates corresponding to the specified sub-image. |
int |
getTarget()
Returns the OpenGL "target" of this texture. |
int |
getTextureObject()
Returns the underlying OpenGL texture object for this texture. |
int |
getWidth()
Returns the width of the texture. |
void |
setTexParameterf(int parameterName,
float value)
Sets the OpenGL floating-point texture parameter for the texture's target. |
void |
setTexParameterfv(int parameterName,
float[] params,
int params_offset)
Sets the OpenGL multi-floating-point texture parameter for the texture's target. |
void |
setTexParameterfv(int parameterName,
FloatBuffer params)
Sets the OpenGL multi-floating-point texture parameter for the texture's target. |
void |
setTexParameteri(int parameterName,
int value)
Sets the OpenGL integer texture parameter for the texture's target. |
void |
setTexParameteriv(int parameterName,
int[] params,
int params_offset)
Sets the OpenGL multi-integer texture parameter for the texture's target. |
void |
setTexParameteriv(int parameterName,
IntBuffer params)
Sets the OpenGL multi-integer texture parameter for the texture's target. |
void |
updateImage(TextureData data)
Updates the entire content area of this texture using the data in the given image. |
void |
updateImage(TextureData data,
int target)
Updates the content area of the specified target of this texture using the data in the given image. |
void |
updateSubImage(TextureData data,
int mipmapLevel,
int x,
int y)
Updates a subregion of the content area of this texture using the data in the given image. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public void enable() throws GLException
GLException
- if no OpenGL context was current or if any
OpenGL-related errors occurredpublic void disable() throws GLException
GLException
- if no OpenGL context was current or if any
OpenGL-related errors occurredpublic void bind() throws GLException
GLException
- if no OpenGL context was current or if any
OpenGL-related errors occurredpublic void dispose() throws GLException
GLException
- if no OpenGL context was current or if any
OpenGL-related errors occurredpublic int getTarget()
GL.GL_TEXTURE_2D
,
GL.GL_TEXTURE_RECTANGLE_ARB
public int getWidth()
public int getHeight()
public int getImageWidth()
public int getImageHeight()
public TextureCoords getImageTexCoords()
public TextureCoords getSubImageTexCoords(int x1, int y1, int x2, int y2)
public void updateImage(TextureData data) throws GLException
GLException
- if no OpenGL context was current or if any
OpenGL-related errors occurredpublic boolean getMustFlipVertically()
getImageTexCoords()
and getSubImageTexCoords(int, int, int, int)
, but applications may generate or
otherwise produce texture coordinates which must be corrected.
public void updateImage(TextureData data, int target) throws GLException
GLException
- if no OpenGL context was current or if any
OpenGL-related errors occurredpublic void updateSubImage(TextureData data, int mipmapLevel, int x, int y) throws GLException
data
- the image data to be uploaded to this texturemipmapLevel
- the mipmap level of the texture to set. If
this is non-zero and the TextureData contains mipmap data, the
appropriate mipmap level will be selected.x
- the x offset (in pixels) relative to the lower-left corner
of this texturey
- the y offset (in pixels) relative to the lower-left corner
of this texture
GLException
- if no OpenGL context was current or if any
OpenGL-related errors occurredpublic void setTexParameterf(int parameterName, float value)
GLException
- if no OpenGL context was current or if any
OpenGL-related errors occurredpublic void setTexParameterfv(int parameterName, FloatBuffer params)
GLException
- if no OpenGL context was current or if any
OpenGL-related errors occurredpublic void setTexParameterfv(int parameterName, float[] params, int params_offset)
GLException
- if no OpenGL context was current or if any
OpenGL-related errors occurredpublic void setTexParameteri(int parameterName, int value)
GLException
- if no OpenGL context was current or if any
OpenGL-related errors occurredpublic void setTexParameteriv(int parameterName, IntBuffer params)
GLException
- if no OpenGL context was current or if any
OpenGL-related errors occurredpublic void setTexParameteriv(int parameterName, int[] params, int params_offset)
GLException
- if no OpenGL context was current or if any
OpenGL-related errors occurredpublic int getTextureObject()
public int getEstimatedMemorySize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |