Class CustomTexture3DData
- java.lang.Object
-
- com.badlogic.gdx.graphics.glutils.CustomTexture3DData
-
- All Implemented Interfaces:
Texture3DData
public class CustomTexture3DData extends java.lang.Object implements Texture3DData
ATexture3DDataimplementation that addresses 2 use cases : You can use it as a GL only texture (feed by a compute shader). In this case the texture is not managed. Or you can use it to upload pixels to GPU. In this case you should callgetPixels()to fill the buffer prior to consuming it (eg. before new Texture3D(data)).
-
-
Constructor Summary
Constructors Constructor Description CustomTexture3DData(int width, int height, int depth, int mipMapLevel, int glFormat, int glInternalFormat, int glType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconsume3DData()Uploads the pixel data to the OpenGL ES texture.intgetDepth()intgetGLFormat()intgetGLType()intgetHeight()intgetInternalFormat()intgetMipMapLevel()java.nio.ByteBuffergetPixels()intgetWidth()booleanisManaged()booleanisPrepared()voidprepare()Prepares the TextureData for a call toTexture3DData.consume3DData().booleanuseMipMaps()
-
-
-
Method Detail
-
isPrepared
public boolean isPrepared()
- Specified by:
isPreparedin interfaceTexture3DData- Returns:
- whether the TextureData is prepared or not.
-
prepare
public void prepare()
Description copied from interface:Texture3DDataPrepares the TextureData for a call toTexture3DData.consume3DData(). This method can be called from a non OpenGL thread and should thus not interact with OpenGL.- Specified by:
preparein interfaceTexture3DData
-
getWidth
public int getWidth()
- Specified by:
getWidthin interfaceTexture3DData- Returns:
- the width of this Texture3D
-
getHeight
public int getHeight()
- Specified by:
getHeightin interfaceTexture3DData- Returns:
- the height of this Texture3D
-
getDepth
public int getDepth()
- Specified by:
getDepthin interfaceTexture3DData- Returns:
- the depth of this Texture3D
-
useMipMaps
public boolean useMipMaps()
- Specified by:
useMipMapsin interfaceTexture3DData- Returns:
- whether to generate mipmaps or not.
-
isManaged
public boolean isManaged()
- Specified by:
isManagedin interfaceTexture3DData- Returns:
- whether this implementation can cope with a EGL context loss.
-
getInternalFormat
public int getInternalFormat()
- Specified by:
getInternalFormatin interfaceTexture3DData- Returns:
- the internal format of this Texture3D
-
getGLType
public int getGLType()
- Specified by:
getGLTypein interfaceTexture3DData- Returns:
- the GL type of this Texture3D
-
getGLFormat
public int getGLFormat()
-
getMipMapLevel
public int getMipMapLevel()
-
getPixels
public java.nio.ByteBuffer getPixels()
-
consume3DData
public void consume3DData()
Description copied from interface:Texture3DDataUploads the pixel data to the OpenGL ES texture. The caller must bind an OpenGL ES texture. A call toTexture3DData.prepare()must preceed a call to this method. Any internal data structures created inTexture3DData.prepare()should be disposed of here.- Specified by:
consume3DDatain interfaceTexture3DData
-
-