public class Texture
extends java.lang.Object
This code based on three.js code.
Modifier and Type | Class and Description |
---|---|
static interface |
Texture.ImageLoadHandler
This callback will be called when the image has been loaded.
|
static class |
Texture.MAPPING_MODE
Mapping modes
|
static class |
Texture.OPERATIONS |
Constructor and Description |
---|
Texture()
Default constructor will create new instance of texture.
|
Texture(com.google.gwt.dom.client.Element image)
Constructor will create a texture instance.
|
Texture(com.google.gwt.dom.client.Element image,
Texture.MAPPING_MODE mapping,
TextureWrapMode wrapS,
TextureWrapMode wrapT,
TextureMagFilter magFilter,
TextureMinFilter minFilter,
PixelFormat format,
PixelType type,
int anisotropy)
Constructor will create a texture instance.
|
Texture(com.google.gwt.user.client.ui.Image image,
Texture.ImageLoadHandler imageLoadHandler)
Constructor
|
Texture(java.lang.String url) |
Texture(java.lang.String url,
Texture.ImageLoadHandler imageLoadHandler) |
Modifier and Type | Method and Description |
---|---|
Texture |
clone()
Clone the texture, where
{@code this.clone() !
|
Texture |
clone(Texture texture) |
void |
deallocate(WebGLRenderer renderer)
Releases a texture from the GL context.
|
int |
getAnisotropy() |
PixelFormat |
getFormat()
Gets the
PixelFormat value. |
int |
getId()
Gets texture ID.
|
com.google.gwt.dom.client.Element |
getImage()
Gets texture media element.
|
TextureMagFilter |
getMagFilter()
Gets the texture magnification function.
|
Texture.MAPPING_MODE |
getMapping()
Get the @{link Texture.MAPPING_MODE} value.
|
TextureMinFilter |
getMinFilter()
Gets the texture minifying function.
|
Vector2 |
getOffset()
Gets texture offset.
|
Vector2 |
getRepeat()
Gets repeat vector.
|
PixelType |
getType()
Sets the
PixelType value. |
int |
getUnpackAlignment() |
WebGLTexture |
getWebGlTexture() |
TextureWrapMode |
getWrapS()
Gets the wrap parameter for texture coordinate S.
|
TextureWrapMode |
getWrapT()
Gets the wrap parameter for texture coordinate T.
|
boolean |
isFlipY() |
boolean |
isGenerateMipmaps()
Checks if needed to generate Mipmaps.
|
java.lang.Boolean |
isNeedsUpdate()
Checks if the texture needs to be updated.
|
boolean |
isPremultiplyAlpha()
Gets premultiply alpha flag.
|
void |
setAnisotropy(int anisotropy)
Method of enhancing the image quality of texture on surfaces
that are at oblique viewing angles.
|
void |
setFlipY(boolean isFlipY) |
void |
setFormat(PixelFormat format)
Sets the
PixelFormat value. |
void |
setGenerateMipmaps(boolean generateMipmaps)
Sets generate Mipmaps flag.
|
void |
setImage(com.google.gwt.dom.client.Element image)
Sets texture media element.
|
void |
setMagFilter(TextureMagFilter magFilter)
Sets the texture magnification function.
|
void |
setMapping(Texture.MAPPING_MODE mapping)
Sets the @{link Texture.MAPPING_MODE} value.
|
void |
setMinFilter(TextureMinFilter minFilter)
Sets the texture minifying function.
|
void |
setNeedsUpdate(java.lang.Boolean needsUpdate)
Sets flag to updated the texture.
|
void |
setOffset(Vector2 offset)
Set texture offset vector.
|
void |
setPremultiplyAlpha(boolean premultiplyAlpha)
Sets premultiply alpha flag.
|
void |
setRepeat(Vector2 repeat)
Sets the repeat vector.
|
void |
setTextureParameters(WebGLRenderingContext gl,
int maxAnisotropy,
TextureTarget textureType,
boolean isImagePowerOfTwo) |
void |
setTextureParameters(WebGLRenderingContext gl,
TextureTarget textureType,
boolean isImagePowerOfTwo) |
void |
setType(PixelType type)
Sets the
PixelType value. |
void |
setUnpackAlignment(int unpackAlignment) |
void |
setWebGlTexture(WebGLTexture webglTexture) |
void |
setWrapS(TextureWrapMode wrapS)
Sets the wrap parameter for texture coordinate S.
|
void |
setWrapT(TextureWrapMode wrapT)
Sets the wrap parameter for texture coordinate T.
|
public Texture()
public Texture(java.lang.String url)
public Texture(java.lang.String url, Texture.ImageLoadHandler imageLoadHandler)
public Texture(com.google.gwt.user.client.ui.Image image, Texture.ImageLoadHandler imageLoadHandler)
image
- the ImageimageLoadHandler
- the Texture.ImageLoadHandler
. Not necessary.public Texture(com.google.gwt.dom.client.Element image)
image
- the media element.public Texture(com.google.gwt.dom.client.Element image, Texture.MAPPING_MODE mapping, TextureWrapMode wrapS, TextureWrapMode wrapT, TextureMagFilter magFilter, TextureMinFilter minFilter, PixelFormat format, PixelType type, int anisotropy)
image
- the media elementmapping
- the @{link Texture.MAPPING_MODE} valuewrapS
- the wrap parameter for texture coordinate S. @see TextureWrapMode
.wrapT
- the wrap parameter for texture coordinate T. @see TextureWrapMode
.magFilter
- the texture magnification function. @see TextureMagFilter
.minFilter
- the texture minifying function. @see TextureMinFilter
.format
- the PixelFormat
value.type
- the DataType
value.anisotropy
- the anisotropy value.public int getId()
public Texture.MAPPING_MODE getMapping()
public void setMapping(Texture.MAPPING_MODE mapping)
public void setWrapS(TextureWrapMode wrapS)
wrapS
- the wrap parameterpublic TextureWrapMode getWrapS()
public void setWrapT(TextureWrapMode wrapT)
wrapT
- the wrap parameterpublic TextureWrapMode getWrapT()
public TextureMagFilter getMagFilter()
public void setMagFilter(TextureMagFilter magFilter)
public TextureMinFilter getMinFilter()
public void setMinFilter(TextureMinFilter minFilter)
public java.lang.Boolean isNeedsUpdate()
public void setNeedsUpdate(java.lang.Boolean needsUpdate)
public com.google.gwt.dom.client.Element getImage()
public void setImage(com.google.gwt.dom.client.Element image)
public Vector2 getOffset()
public void setOffset(Vector2 offset)
offset
- the offset vector.public Vector2 getRepeat()
public void setRepeat(Vector2 repeat)
repeat
- the repeat vector.public PixelFormat getFormat()
PixelFormat
value.PixelFormat
value.public void setFormat(PixelFormat format)
PixelFormat
value.format
- the PixelFormat
value.public void setType(PixelType type)
PixelType
value.type
- the PixelType
value.public boolean isGenerateMipmaps()
public void setGenerateMipmaps(boolean generateMipmaps)
public boolean isPremultiplyAlpha()
public int getAnisotropy()
public void setAnisotropy(int anisotropy)
public void setPremultiplyAlpha(boolean premultiplyAlpha)
public boolean isFlipY()
public void setFlipY(boolean isFlipY)
public int getUnpackAlignment()
public void setUnpackAlignment(int unpackAlignment)
public WebGLTexture getWebGlTexture()
public void setWebGlTexture(WebGLTexture webglTexture)
public void setTextureParameters(WebGLRenderingContext gl, TextureTarget textureType, boolean isImagePowerOfTwo)
public void setTextureParameters(WebGLRenderingContext gl, int maxAnisotropy, TextureTarget textureType, boolean isImagePowerOfTwo)
public void deallocate(WebGLRenderer renderer)
public Texture clone()
this.clone() != this
clone
in class java.lang.Object