A Texture can be managed. If the OpenGL context is lost all managed textures get invalidated. This happens when a user switches to another application or receives an incoming call. Managed textures get reloaded automatically.
A Texture has to be bound via the Texture#bind() method in order for it to be applied to geometry. The texture will be
bound to the currently active texture unit specified via GL20#glActiveTexture(int).
You can draw Pixmaps to a texture at any time. The changes will be automatically uploaded to texture memory. This is of
course not extremely fast so use it with care. It also only works with unmanaged textures.
A Texture must be disposed when it is no longer used
| Modifier and Type | Class and Description |
|---|---|
| public static enum | |
| public static enum |
| Modifier and Type | Field and Description |
|---|---|
| private static AssetManager | |
| pack-priv TextureData | |
| pack-priv static final Map |
| Access | Constructor and Description |
|---|---|
| protected | |
| public | |
| public | |
| public | |
| public | |
| public | |
| public | |
| public | |
| public | |
| public | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| private static void | |
| public static void | |
| public void | dispose()
Overrides com. Implements com. Disposes all resources associated with the texture |
| public void | |
| public int | |
| public int | |
| public static String | |
| public static int | |
| public TextureData | |
| public int | |
| public static void | |
| public boolean | isManaged()
Implements abstract com. Returns: whether this texture is managed or not. |
| public void | |
| protected void | reload()
Implements abstract com. Used internally to reload after context loss. |
| public static void | |
| public String |
| assetManager | back to summary |
|---|---|
| private static AssetManager assetManager | |
| data | back to summary |
|---|---|
| pack-priv TextureData data | |
| managedTextures | back to summary |
|---|---|
| pack-priv static final Map<Application, Array<Texture>> managedTextures | |
| Texture | back to summary |
|---|---|
| protected Texture() | |
| Texture | back to summary |
|---|---|
| public Texture(String internalPath) | |
| Texture | back to summary |
|---|---|
| public Texture(FileHandle file) | |
| Texture | back to summary |
|---|---|
| public Texture(FileHandle file, boolean useMipMaps) | |
| Texture | back to summary |
|---|---|
| public Texture(FileHandle file, Pixmap. | |
| Texture | back to summary |
|---|---|
| public Texture(Pixmap pixmap) | |
| Texture | back to summary |
|---|---|
| public Texture(Pixmap pixmap, boolean useMipMaps) | |
| Texture | back to summary |
|---|---|
| public Texture(Pixmap pixmap, Pixmap. | |
| Texture | back to summary |
|---|---|
| public Texture(int width, int height, Pixmap. | |
| Texture | back to summary |
|---|---|
| public Texture(TextureData data) | |
| Texture | back to summary |
|---|---|
| protected Texture(int glTarget, int glHandle, TextureData data) | |
| addManagedTexture | back to summary |
|---|---|
| private static void addManagedTexture(Application app, Texture texture) | |
| clearAllTextures | back to summary |
|---|---|
| public static void clearAllTextures(Application app) Clears all managed textures. This is an internal method. Do not use it! | |
| dispose | back to summary |
|---|---|
| public void dispose() Overrides com. Implements com. Disposes all resources associated with the texture | |
| draw | back to summary |
|---|---|
| public void draw(Pixmap pixmap, int x, int y) Draws the given
| |
| getDepth | back to summary |
|---|---|
| public int getDepth() Implements abstract com.
| |
| getHeight | back to summary |
|---|---|
| public int getHeight() Implements abstract com.
| |
| getManagedStatus | back to summary |
|---|---|
| public static String getManagedStatus() | |
| getNumManagedTextures | back to summary |
|---|---|
public static int getNumManagedTextures()
| |
| getTextureData | back to summary |
|---|---|
| public TextureData getTextureData() | |
| getWidth | back to summary |
|---|---|
| public int getWidth() Implements abstract com.
| |
| invalidateAllTextures | back to summary |
|---|---|
| public static void invalidateAllTextures(Application app) Invalidate all managed textures. This is an internal method. Do not use it! | |
| isManaged | back to summary |
|---|---|
| public boolean isManaged() Implements abstract com.
| |
| load | back to summary |
|---|---|
| public void load(TextureData data) | |
| reload | back to summary |
|---|---|
| protected void reload() Implements abstract com. Used internally to reload after context loss. Creates a new GL handle then calls
| |
| setAssetManager | back to summary |
|---|---|
| public static void setAssetManager(AssetManager manager) Sets the
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final int | |
| public static final Texture. | Linear
Fetch four nearest texels that best maps to the pixel on screen. |
| public static final Texture. | |
| public static final Texture. | MipMapLinearLinear
Fetch the two best fitting images from the mip map chain and then sample the four nearest texels from each of the two images, combining them to the final output pixel. |
| public static final Texture. | MipMapLinearNearest
Fetch the best fitting image from the mip map chain based on the pixel/texel ratio and then sample the texels with a linear filter. |
| public static final Texture. | MipMapNearestLinear
Fetch the two best fitting images from the mip map chain and then sample the nearest texel from each of the two images, combining them to the final output pixel. |
| public static final Texture. | MipMapNearestNearest
Fetch the best fitting image from the mip map chain based on the pixel/texel ratio and then sample the texels with a nearest filter. |
| public static final Texture. | Nearest
Fetch the nearest texel that best maps to the pixel on screen. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public boolean | |
| public static Texture. | |
| public static Texture. |
| glEnum | back to summary |
|---|---|
| pack-priv final int glEnum | |
| Linear | back to summary |
|---|---|
| public static final Texture. Fetch four nearest texels that best maps to the pixel on screen. | |
| MipMap | back to summary |
|---|---|
public static final Texture.
| |
| MipMapLinearLinear | back to summary |
|---|---|
| public static final Texture. Fetch the two best fitting images from the mip map chain and then sample the four nearest texels from each of the two images, combining them to the final output pixel. | |
| MipMapLinearNearest | back to summary |
|---|---|
| public static final Texture. Fetch the best fitting image from the mip map chain based on the pixel/texel ratio and then sample the texels with a linear filter. | |
| MipMapNearestLinear | back to summary |
|---|---|
| public static final Texture. Fetch the two best fitting images from the mip map chain and then sample the nearest texel from each of the two images, combining them to the final output pixel. | |
| MipMapNearestNearest | back to summary |
|---|---|
| public static final Texture. Fetch the best fitting image from the mip map chain based on the pixel/texel ratio and then sample the texels with a nearest filter. | |
| Nearest | back to summary |
|---|---|
| public static final Texture. Fetch the nearest texel that best maps to the pixel on screen. | |
| TextureFilter | back to summary |
|---|---|
| private TextureFilter(int glEnum) | |
| getGLEnum | back to summary |
|---|---|
| public int getGLEnum() | |
| isMipMap | back to summary |
|---|---|
| public boolean isMipMap() | |
| valueOf | back to summary |
|---|---|
| public static Texture. | |
| values | back to summary |
|---|---|
| public static Texture. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final Texture. | |
| pack-priv final int | |
| public static final Texture. | |
| public static final Texture. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public static Texture. | |
| public static Texture. |
| ClampToEdge | back to summary |
|---|---|
| public static final Texture. | |
| glEnum | back to summary |
|---|---|
| pack-priv final int glEnum | |
| MirroredRepeat | back to summary |
|---|---|
| public static final Texture. | |
| Repeat | back to summary |
|---|---|
| public static final Texture. | |
| TextureWrap | back to summary |
|---|---|
| private TextureWrap(int glEnum) | |
| getGLEnum | back to summary |
|---|---|
| public int getGLEnum() | |
| valueOf | back to summary |
|---|---|
| public static Texture. | |
| values | back to summary |
|---|---|
| public static Texture. | |