public abstract class GLTexture extends Object implements Disposable
Modifier and Type | Field and Description |
---|---|
int |
glTarget
The target of this texture, used when binding the texture, e.g.
|
Constructor and Description |
---|
GLTexture(int glTarget)
Generates a new OpenGL texture with the specified target.
|
GLTexture(int glTarget,
int glHandle) |
Modifier and Type | Method and Description |
---|---|
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() |
abstract int |
getHeight() |
Texture.TextureFilter |
getMagFilter() |
Texture.TextureFilter |
getMinFilter() |
int |
getTextureObjectHandle() |
Texture.TextureWrap |
getUWrap() |
Texture.TextureWrap |
getVWrap() |
abstract int |
getWidth() |
abstract boolean |
isManaged() |
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. |
static void |
uploadImageData(int target,
TextureData data,
int miplevel) |
public final int glTarget
public GLTexture(int glTarget)
public GLTexture(int glTarget, int glHandle)
public abstract int getWidth()
public abstract int getHeight()
public abstract int getDepth()
public abstract boolean isManaged()
public void bind()
GL20.glActiveTexture(int)
.public void bind(int unit)
GL20.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 uploadImageData(int target, TextureData data, int miplevel)
Copyright © 2015. All rights reserved.