Package arc.graphics.gl
Class FloatTextureData
java.lang.Object
arc.graphics.gl.FloatTextureData
- All Implemented Interfaces:
TextureData
A
TextureData
implementation which should be used to create float textures.-
Constructor Summary
ConstructorDescriptionFloatTextureData
(int w, int h, int internalFormat, int format, int type, boolean isGpuOnly) -
Method Summary
Modifier and TypeMethodDescriptionvoid
consumeCustomData
(int target) Uploads the pixel data to the OpenGL ES texture.Returns thePixmap
for upload by Texture.boolean
int
int
getWidth()
boolean
isCustom()
boolean
void
prepare()
Prepares the TextureData for a call toTextureData.consumePixmap()
orTextureData.consumeCustomData(int)
.boolean
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface arc.graphics.TextureData
getPixmap
-
Constructor Details
-
FloatTextureData
public FloatTextureData(int w, int h, int internalFormat, int format, int type, boolean isGpuOnly)
-
-
Method Details
-
isCustom
public boolean isCustom()- Specified by:
isCustom
in interfaceTextureData
- Returns:
- whether to use #consumeCustomData
-
isPrepared
public boolean isPrepared()- Specified by:
isPrepared
in interfaceTextureData
- Returns:
- whether the TextureData is prepared or not.
-
prepare
public void prepare()Description copied from interface:TextureData
Prepares 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:
prepare
in interfaceTextureData
-
consumeCustomData
public void consumeCustomData(int target) Description copied from interface:TextureData
Uploads the pixel data to the OpenGL ES texture. The caller must bind an OpenGL ES 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:
consumeCustomData
in interfaceTextureData
-
consumePixmap
Description copied from interface:TextureData
Returns thePixmap
for 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:
consumePixmap
in interfaceTextureData
- Returns:
- the pixmap.
-
disposePixmap
public boolean disposePixmap()- Specified by:
disposePixmap
in interfaceTextureData
- Returns:
- whether the caller of
TextureData.consumePixmap()
should dispose the Pixmap returned byTextureData.consumePixmap()
-
getWidth
public int getWidth()- Specified by:
getWidth
in interfaceTextureData
- Returns:
- the width of the pixel data
-
getHeight
public int getHeight()- Specified by:
getHeight
in interfaceTextureData
- Returns:
- the height of the pixel data
-
getFormat
- Specified by:
getFormat
in interfaceTextureData
- Returns:
- the
Pixmap.Format
of the pixel data
-
useMipMaps
public boolean useMipMaps()- Specified by:
useMipMaps
in interfaceTextureData
- Returns:
- whether to generate mipmaps or not.
-
getBuffer
-