|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.badlogic.gdx.graphics.GLTexture
public abstract class GLTexture
Class representing an OpenGL texture by its target and handle. Keeps track of its state like the TextureFilter and TextureWrap. Also provides some (protected) static methods to create TextureData and upload image data.
Field Summary | |
---|---|
int |
glTarget
The target of this texture, used when binding the texture, e.g. |
Constructor Summary | |
---|---|
GLTexture(int glTarget)
Generates a new OpenGL texture with the specified target. |
|
GLTexture(int glTarget,
int glHandle)
|
Method Summary | |
---|---|
void |
bind()
Binds this texture. |
void |
bind(int unit)
Binds the texture to the given texture unit. |
void |
dispose()
Releases all resources of this object. |
abstract int |
getDepth()
|
static boolean |
getEnforcePotImage()
|
abstract int |
getHeight()
|
Texture.TextureFilter |
getMagFilter()
|
Texture.TextureFilter |
getMinFilter()
|
int |
getTextureObjectHandle()
|
Texture.TextureWrap |
getUWrap()
|
Texture.TextureWrap |
getVWrap()
|
abstract int |
getWidth()
|
abstract boolean |
isManaged()
|
static void |
setEnforcePotImages(boolean enforcePotImages)
|
void |
setFilter(Texture.TextureFilter minFilter,
Texture.TextureFilter magFilter)
Sets the Texture.TextureFilter for this texture for minification and magnification. |
void |
setWrap(Texture.TextureWrap u,
Texture.TextureWrap v)
Sets the Texture.TextureWrap for this texture on the u and v axis. |
void |
unsafeSetFilter(Texture.TextureFilter minFilter,
Texture.TextureFilter magFilter)
Sets the Texture.TextureFilter for this texture for minification and magnification. |
void |
unsafeSetFilter(Texture.TextureFilter minFilter,
Texture.TextureFilter magFilter,
boolean force)
Sets the Texture.TextureFilter for this texture for minification and magnification. |
void |
unsafeSetWrap(Texture.TextureWrap u,
Texture.TextureWrap v)
Sets the Texture.TextureWrap for this texture on the u and v axis. |
void |
unsafeSetWrap(Texture.TextureWrap u,
Texture.TextureWrap v,
boolean force)
Sets the Texture.TextureWrap for this texture on the u and v axis. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final int glTarget
Constructor Detail |
---|
public GLTexture(int glTarget)
public GLTexture(int glTarget, int glHandle)
Method Detail |
---|
public abstract int getWidth()
public abstract int getHeight()
public abstract int getDepth()
public abstract boolean isManaged()
public void bind()
GLCommon.glActiveTexture(int)
.
public void bind(int unit)
GLCommon.glActiveTexture(int)
.
unit
- the unit (0 to MAX_TEXTURE_UNITS).public Texture.TextureFilter getMinFilter()
Texture.TextureFilter
used for minification.public Texture.TextureFilter getMagFilter()
Texture.TextureFilter
used for magnification.public Texture.TextureWrap getUWrap()
Texture.TextureWrap
used for horizontal (U) texture coordinates.public Texture.TextureWrap getVWrap()
Texture.TextureWrap
used for vertical (V) texture coordinates.public int getTextureObjectHandle()
public void unsafeSetWrap(Texture.TextureWrap u, Texture.TextureWrap v)
Texture.TextureWrap
for this texture on the u and v axis. Assumes the texture is bound and active!
u
- the u wrapv
- the v wrappublic void unsafeSetWrap(Texture.TextureWrap u, Texture.TextureWrap v, boolean force)
Texture.TextureWrap
for this texture on the u and v axis. Assumes the texture is bound and active!
u
- the u wrapv
- the v wrapforce
- True to always set the values, even if they are the same as the current values.public void setWrap(Texture.TextureWrap u, Texture.TextureWrap v)
Texture.TextureWrap
for this texture on the u and v axis. This will bind this texture!
u
- the u wrapv
- the v wrappublic void unsafeSetFilter(Texture.TextureFilter minFilter, Texture.TextureFilter magFilter)
Texture.TextureFilter
for this texture for minification and magnification.
Assumes the texture is bound and active!
minFilter
- the minification filtermagFilter
- the magnification filterpublic void unsafeSetFilter(Texture.TextureFilter minFilter, Texture.TextureFilter magFilter, boolean force)
Texture.TextureFilter
for this texture for minification and magnification.
Assumes the texture is bound and active!
minFilter
- the minification filtermagFilter
- the magnification filterforce
- True to always set the values, even if they are the same as the current values.public void setFilter(Texture.TextureFilter minFilter, Texture.TextureFilter magFilter)
Texture.TextureFilter
for this texture for minification and magnification.
This will bind this texture!
minFilter
- the minification filtermagFilter
- the magnification filterpublic void dispose()
Disposable
dispose
in interface Disposable
public static void setEnforcePotImages(boolean enforcePotImages)
enforcePotImages
- whether to enforce power of two images in OpenGL ES 1.0 or not.public static boolean getEnforcePotImage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |