public interface TextureData
Texture
to load the pixel data. A TextureData can either return a Pixmap
or upload the pixel data
itself. It signals it's type via getType()
to the Texture that's using it. The Texture will then either invoke
consumePixmap()
or consumeCustomData(int)
. These are the first methods to be called by Texture. After
that the Texture will invoke the other methods to find out about the size of the image data, the format, whether mipmaps should
be generated and whether the TextureData is able to manage the pixel data if the OpenGL ES context is lost.
In case the TextureData implementation has the type TextureData.TextureDataType.Custom
, the implementation has to generate the
mipmaps itself if necessary. See MipMapGenerator
.
Before a call to either consumePixmap()
or consumeCustomData(int)
, Texture will bind the OpenGL ES
texture.
Look at FileTextureData
and ETC1TextureData
for example implementations of this interface.Modifier and Type | Interface and Description |
---|---|
static class |
TextureData.TextureDataType
The type of this
TextureData . |
Modifier and Type | Method and Description |
---|---|
void |
consumeCustomData(int target)
Uploads the pixel data to the OpenGL ES texture.
|
Pixmap |
consumePixmap()
Returns the
Pixmap for upload by Texture. |
boolean |
disposePixmap() |
Pixmap.Format |
getFormat() |
int |
getHeight() |
TextureData.TextureDataType |
getType() |
int |
getWidth() |
boolean |
isManaged() |
boolean |
isPrepared() |
void |
prepare()
Prepares the TextureData for a call to
consumePixmap() or consumeCustomData(int) . |
boolean |
useMipMaps() |
TextureData.TextureDataType getType()
TextureData.TextureDataType
boolean isPrepared()
void prepare()
consumePixmap()
or consumeCustomData(int)
. This method can be
called from a non OpenGL thread and should thus not interact with OpenGL.Pixmap consumePixmap()
Pixmap
for upload by Texture. A call to prepare()
must precede a call to this method. Any
internal data structures created in prepare()
should be disposed of here.boolean disposePixmap()
consumePixmap()
should dispose the Pixmap returned by consumePixmap()
void consumeCustomData(int target)
int getWidth()
int getHeight()
Pixmap.Format getFormat()
Pixmap.Format
of the pixel databoolean useMipMaps()
boolean isManaged()
Copyright © 2014. All rights reserved.