Class MipMapTextureData
- java.lang.Object
-
- com.badlogic.gdx.graphics.glutils.MipMapTextureData
-
- All Implemented Interfaces:
TextureData
public class MipMapTextureData extends java.lang.Object implements TextureData
This class will load each contained TextureData to the chosen mipmap level. All the mipmap levels must be defined and cannot be null.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.badlogic.gdx.graphics.TextureData
TextureData.Factory, TextureData.TextureDataType
-
-
Constructor Summary
Constructors Constructor Description MipMapTextureData(TextureData... mipMapData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconsumeCustomData(int target)Uploads the pixel data to the OpenGL ES texture.PixmapconsumePixmap()Returns thePixmapfor upload by Texture.booleandisposePixmap()Pixmap.FormatgetFormat()intgetHeight()TextureData.TextureDataTypegetType()intgetWidth()booleanisManaged()booleanisPrepared()voidprepare()Prepares the TextureData for a call toTextureData.consumePixmap()orTextureData.consumeCustomData(int).booleanuseMipMaps()
-
-
-
Constructor Detail
-
MipMapTextureData
public MipMapTextureData(TextureData... mipMapData)
- Parameters:
mipMapData- must be != null and its length must be >= 1
-
-
Method Detail
-
getType
public TextureData.TextureDataType getType()
- Specified by:
getTypein interfaceTextureData- Returns:
- the
TextureData.TextureDataType
-
isPrepared
public boolean isPrepared()
- Specified by:
isPreparedin interfaceTextureData- Returns:
- whether the TextureData is prepared or not.
-
prepare
public void prepare()
Description copied from interface:TextureDataPrepares the TextureData for a call toTextureData.consumePixmap()orTextureData.consumeCustomData(int). This method can be called from a non OpenGL thread and should thus not interact with OpenGL.- Specified by:
preparein interfaceTextureData
-
consumePixmap
public Pixmap consumePixmap()
Description copied from interface:TextureDataReturns thePixmapfor upload by Texture. A call toTextureData.prepare()must precede a call to this method. Any internal data structures created inTextureData.prepare()should be disposed of here.- Specified by:
consumePixmapin interfaceTextureData- Returns:
- the pixmap.
-
disposePixmap
public boolean disposePixmap()
- Specified by:
disposePixmapin interfaceTextureData- Returns:
- whether the caller of
TextureData.consumePixmap()should dispose the Pixmap returned byTextureData.consumePixmap()
-
consumeCustomData
public void consumeCustomData(int target)
Description copied from interface:TextureDataUploads the pixel data to the OpenGL ES texture. The caller must bind an OpenGL ES texture. A call toTextureData.prepare()must preceed a call to this method. Any internal data structures created inTextureData.prepare()should be disposed of here.- Specified by:
consumeCustomDatain interfaceTextureData
-
getWidth
public int getWidth()
- Specified by:
getWidthin interfaceTextureData- Returns:
- the width of the pixel data
-
getHeight
public int getHeight()
- Specified by:
getHeightin interfaceTextureData- Returns:
- the height of the pixel data
-
getFormat
public Pixmap.Format getFormat()
- Specified by:
getFormatin interfaceTextureData- Returns:
- the
Pixmap.Formatof the pixel data
-
useMipMaps
public boolean useMipMaps()
- Specified by:
useMipMapsin interfaceTextureData- Returns:
- whether to generate mipmaps or not.
-
isManaged
public boolean isManaged()
- Specified by:
isManagedin interfaceTextureData- Returns:
- whether this implementation can cope with a EGL context loss.
-
-