Package com.jme3.texture
Class TextureImage
java.lang.Object
com.jme3.texture.TextureImage
Wraps a texture so that only a single level of the underlying image is bound
instead of the entire image.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum specifying the shader access hint of the image. -
Constructor Summary
ConstructorsConstructorDescriptionTextureImage(Texture texture) TextureImage(Texture texture, int level, int layer) TextureImage(Texture texture, int level, int layer, TextureImage.Access access) TextureImage(Texture texture, TextureImage.Access access) -
Method Summary
Modifier and TypeMethodDescriptionvoidbindImage(GL4 gl4, TextureUtil texUtil, int unit) Binds this texture image to the texture unit.booleanClears the update flag and returns the update flag's value before it was cleared.Gets the access hint.Gets the format of the image belonging to the underlying texture.getImage()Gets the image belonging to the underlying texture.intGets the native id of the image belonging to the underlying texture.intgetLayer()Gets the layer.intgetLevel()Gets the level.Gets the underlying texture wrapped by this TextureImage.booleanReturns true if all layers of an image will be bound, whenlayeris negative.booleanReturns true if the update flag has been set indicating rebinding is required.voidsetAccess(TextureImage.Access access) Sets the shader access hint with which to bind the image.voidsetLayer(int layer) Sets the image layer to bind.voidsetLevel(int level) Sets the image level to bind.voidsetTexture(Texture texture) Sets the underlying texture wrapped by this TextureImage.voidSets the update flag indicating this texture image needs rebinding.
-
Constructor Details
-
TextureImage
-
TextureImage
-
TextureImage
-
TextureImage
-
-
Method Details
-
bindImage
Binds this texture image to the texture unit.Calling this is not completely sufficient for totally binding an image to an image unit. Additionally, the image must be bound beforehand using
GL.glBindTexture(int, int).- Parameters:
gl4- GL4 implementation (not null)texUtil- utility used to convert JME's image format to the corresponding GL enum (not null)unit- texture unit to bind to
-
setUpdateNeeded
public void setUpdateNeeded()Sets the update flag indicating this texture image needs rebinding. -
clearUpdateNeeded
public boolean clearUpdateNeeded()Clears the update flag and returns the update flag's value before it was cleared.- Returns:
-
setTexture
Sets the underlying texture wrapped by this TextureImage.- Parameters:
texture- wrapped texture (not null)
-
setLevel
public void setLevel(int level) Sets the image level to bind.The level controls which mipmap level will be bound to the texture unit, where zero corresponds to the base level of the texture.
default=0
- Parameters:
level- level to bind (not negative)
-
setLayer
public void setLayer(int layer) Sets the image layer to bind.If the underlying texture is a one/two/three demensional array, cube map, cube map array, or two demensional multisample array, then this value specifies which layer of the array to bind.
default=-1
- Parameters:
layer- layer to bind, or negative to bind all layers
-
setAccess
Sets the shader access hint with which to bind the image.- Parameters:
access-
-
getTexture
Gets the underlying texture wrapped by this TextureImage.- Returns:
- underlying texture
-
getImage
Gets the image belonging to the underlying texture.- Returns:
-
getFormat
Gets the format of the image belonging to the underlying texture.- Returns:
-
getImageId
public int getImageId()Gets the native id of the image belonging to the underlying texture.- Returns:
-
getLevel
public int getLevel()Gets the level.- Returns:
- See Also:
-
getLayer
public int getLayer()Gets the layer.- Returns:
- See Also:
-
getAccess
Gets the access hint.- Returns:
- See Also:
-
isLayered
public boolean isLayered()Returns true if all layers of an image will be bound, whenlayeris negative.- Returns:
- See Also:
-
isUpdateNeeded
public boolean isUpdateNeeded()Returns true if the update flag has been set indicating rebinding is required.- Returns:
-