APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.graphics.glutils

public Class CustomTexture3DData

extends Object
implements Texture3DData
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.graphics.Texture3DData
Imports
java.nio.ByteBuffer, com.badlogic.gdx.Gdx, com.badlogic.gdx.graphics.GL30, .Texture3DData, com.badlogic.gdx.utils.BufferUtils, .GdxRuntimeException

A Texture3DData implementation 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 call getPixels() to fill the buffer prior to consuming it (eg. before new Texture3D(data)).
Author
mgsx

Field Summary

Modifier and TypeField and Description
private int
private int
private int
private int
private int
private int
private ByteBuffer
private int

Constructor Summary

AccessConstructor and Description
public
CustomTexture3DData(int width, int height, int depth, int mipMapLevel, int glFormat, int glInternalFormat, int glType)

Method Summary

Modifier and TypeMethod and Description
public void
consume3DData()

Implements com.badlogic.gdx.graphics.Texture3DData.consume3DData.

Uploads the pixel data to the OpenGL ES texture.

public int
public int
public int
public int
public int
public int
public ByteBuffer
public int
public boolean
public boolean
public void
prepare()

Implements com.badlogic.gdx.graphics.Texture3DData.prepare.

Prepares the TextureData for a call to consume3DData().

public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

depthback to summary
private int depth
glFormatback to summary
private int glFormat
glInternalFormatback to summary
private int glInternalFormat
glTypeback to summary
private int glType
heightback to summary
private int height
mipMapLevelback to summary
private int mipMapLevel
pixelsback to summary
private ByteBuffer pixels
widthback to summary
private int width

Constructor Detail

CustomTexture3DDataback to summary
public CustomTexture3DData(int width, int height, int depth, int mipMapLevel, int glFormat, int glInternalFormat, int glType)
See Also
https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glTexImage3D.xhtml

Method Detail

consume3DDataback to summary
public void consume3DData()

Implements com.badlogic.gdx.graphics.Texture3DData.consume3DData.

Doc from com.badlogic.gdx.graphics.Texture3DData.consume3DData.

Uploads the pixel data to the OpenGL ES texture. The caller must bind an OpenGL ES texture. A call to prepare() must preceed a call to this method. Any internal data structures created in prepare() should be disposed of here.

Annotations
@Override
getDepthback to summary
public int getDepth()

Implements com.badlogic.gdx.graphics.Texture3DData.getDepth.

getGLFormatback to summary
public int getGLFormat()
getGLTypeback to summary
public int getGLType()

Implements com.badlogic.gdx.graphics.Texture3DData.getGLType.

getHeightback to summary
public int getHeight()

Implements com.badlogic.gdx.graphics.Texture3DData.getHeight.

Annotations
@Override
getInternalFormatback to summary
public int getInternalFormat()

Implements com.badlogic.gdx.graphics.Texture3DData.getInternalFormat.

getMipMapLevelback to summary
public int getMipMapLevel()
getPixelsback to summary
public ByteBuffer getPixels()
getWidthback to summary
public int getWidth()

Implements com.badlogic.gdx.graphics.Texture3DData.getWidth.

Annotations
@Override
isManagedback to summary
public boolean isManaged()

Implements com.badlogic.gdx.graphics.Texture3DData.isManaged.

Annotations
@Override
isPreparedback to summary
public boolean isPrepared()

Implements com.badlogic.gdx.graphics.Texture3DData.isPrepared.

Annotations
@Override
prepareback to summary
public void prepare()

Implements com.badlogic.gdx.graphics.Texture3DData.prepare.

Doc from com.badlogic.gdx.graphics.Texture3DData.prepare.

Prepares the TextureData for a call to consume3DData(). This method can be called from a non OpenGL thread and should thus not interact with OpenGL.

Annotations
@Override
useMipMapsback to summary
public boolean useMipMaps()

Implements com.badlogic.gdx.graphics.Texture3DData.useMipMaps.

Annotations
@Override