|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.java.joglutils.msg.nodes.Node
net.java.joglutils.msg.nodes.Texture2
public class Texture2
Represents a two-dimensional texture which can be set up from all of the image sources supported by the JOGL TextureIO classes or the JOGL TextureRenderer. If set up with a texture, supports updating of the texture as well. Supports switching between use of a TextureRenderer and a Texture.
Field Summary | |
---|---|
static int |
BLEND
Represents the OpenGL BLEND texture environment mode. |
static int |
DECAL
Represents the OpenGL DECAL texture environment mode. |
static int |
MODULATE
Represents the OpenGL MODULATE texture environment mode. |
static int |
REPLACE
Represents the OpenGL REPLACE texture environment mode. |
Constructor Summary | |
---|---|
Texture2()
|
Method Summary | |
---|---|
void |
dispose()
Disposes of the OpenGL texture and/or TextureRenderer this Texture2 node refers to. |
void |
doAction(Action action)
Performs the "typical" operation for this node when an action is applied to it. |
int |
getHeight()
Returns the height of the texture or TextureRenderer this Texture2 node is referencing, or 0 if it has not been set up yet. |
int |
getTexEnvMode()
Returns the texture environment mode: one of MODULATE, DECAL, BLEND, or REPLACE. |
com.sun.opengl.util.texture.Texture |
getTexture()
Fetches the Texture object associated with this Texture2 node, refreshing its content if necessary. |
com.sun.opengl.util.j2d.TextureRenderer |
getTextureRenderer()
Returns the TextureRenderer, if one has been set, that is associated with this Texture2 node. |
int |
getWidth()
Returns the width of the texture or TextureRenderer this Texture2 node is referencing, or 0 if it has not been set up yet. |
void |
initTextureRenderer(int width,
int height,
boolean alpha)
Initializes this node to operate upon a TextureRenderer of the specified width, height, and presence of an alpha channel. |
void |
resetGL(GLResetAction action)
Resets the OpenGL state of this node without explicitly disposing of any resources. |
void |
setTexEnvMode(int mode)
Sets the texture environment mode. |
void |
setTexture(BufferedImage image,
boolean mipmap)
Initializes this texture from the given BufferedImage. |
void |
setTexture(File file,
boolean mipmap,
String fileSuffix)
Initializes this texture from the given file. |
void |
setTexture(InputStream stream,
boolean mipmap,
String fileSuffix)
Initializes this texture from the given InputStream. |
void |
setTexture(com.sun.opengl.util.texture.TextureData data)
Initializes this texture from the given TextureData. |
void |
setTexture(URL url,
boolean mipmap,
String fileSuffix)
Initializes this texture from the given URL. |
void |
updateSubImage(com.sun.opengl.util.texture.TextureData data,
int mipmapLevel,
int dstx,
int dsty,
int srcx,
int srcy,
int width,
int height)
Updates a subregion of the content area of this texture using the specified sub-region of the given data. |
Methods inherited from class net.java.joglutils.msg.nodes.Node |
---|
rayPick, render |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MODULATE
public static final int DECAL
public static final int BLEND
public static final int REPLACE
Constructor Detail |
---|
public Texture2()
Method Detail |
---|
public void setTexture(File file, boolean mipmap, String fileSuffix) throws IOException
IOException
public void setTexture(InputStream stream, boolean mipmap, String fileSuffix) throws IOException
IOException
public void setTexture(URL url, boolean mipmap, String fileSuffix) throws IOException
IOException
public void setTexture(BufferedImage image, boolean mipmap)
public void setTexture(com.sun.opengl.util.texture.TextureData data)
public int getWidth()
public int getHeight()
public void updateSubImage(com.sun.opengl.util.texture.TextureData data, int mipmapLevel, int dstx, int dsty, int srcx, int srcy, int width, int height)
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.dstx
- the x offset (in pixels) relative to the lower-left corner
of this texture where the update will be applieddsty
- the y offset (in pixels) relative to the lower-left corner
of this texture where the update will be appliedsrcx
- the x offset (in pixels) relative to the lower-left corner
of the supplied TextureData from which to fetch the update rectanglesrcy
- the y offset (in pixels) relative to the lower-left corner
of the supplied TextureData from which to fetch the update rectanglewidth
- the width (in pixels) of the rectangle to be updatedheight
- the height (in pixels) of the rectangle to be updatedpublic void initTextureRenderer(int width, int height, boolean alpha)
TextureRenderer.markDirty()
is used properly.
public com.sun.opengl.util.j2d.TextureRenderer getTextureRenderer()
public com.sun.opengl.util.texture.Texture getTexture() throws javax.media.opengl.GLException
javax.media.opengl.GLException
public void setTexEnvMode(int mode)
public int getTexEnvMode()
public void doAction(Action action)
Node
doAction
in class Node
public void dispose() throws javax.media.opengl.GLException
javax.media.opengl.GLException
public void resetGL(GLResetAction action)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |