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

public Class GLOnlyTextureData

extends Object
implements TextureData
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.graphics.TextureData
Imports
com.badlogic.gdx.Gdx, com.badlogic.gdx.graphics.GL20, .Pixmap, .Pixmap.Format, .TextureData, com.badlogic.gdx.utils.GdxRuntimeException

A TextureData implementation which should be used to create gl only textures. This TextureData fits perfectly for FrameBuffer. The data is not managed.

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv int
pack-priv int
pack-priv boolean
pack-priv int
mipLevel

properties of opengl texture

pack-priv int
pack-priv int
width

width and height

Constructor Summary

AccessConstructor and Description
public
GLOnlyTextureData(int width, int height, int mipMapLevel, int
Specifies the internal format of the texture. Must be one of the following symbolic constants: GL20#GL_ALPHA, GL20#GL_LUMINANCE, GL20#GL_LUMINANCE_ALPHA, GL20#GL_RGB, GL20#GL_RGBA.
internalFormat
,
int
Specifies the format of the texel data. Must match internalformat. The following symbolic values are accepted: GL20#GL_ALPHA, GL20#GL_RGB, GL20#GL_RGBA, GL20#GL_LUMINANCE, and GL20#GL_LUMINANCE_ALPHA.
format
,
int
Specifies the data type of the texel data. The following symbolic values are accepted: GL20#GL_UNSIGNED_BYTE, GL20#GL_UNSIGNED_SHORT_5_6_5, GL20#GL_UNSIGNED_SHORT_4_4_4_4, and GL20#GL_UNSIGNED_SHORT_5_5_5_1.
type
)

Method Summary

Modifier and TypeMethod and Description
public void
consumeCustomData(int target)

Implements com.badlogic.gdx.graphics.TextureData.consumeCustomData.

Uploads the pixel data to the OpenGL ES texture.

public Pixmap
consumePixmap()

Implements com.badlogic.gdx.graphics.TextureData.consumePixmap.

Returns the Pixmap for upload by Texture.

public boolean
public Pixmap.Format
public int
public TextureData.TextureDataType
public int
public boolean
public boolean
public void
prepare()

Implements com.badlogic.gdx.graphics.TextureData.prepare.

Prepares the TextureData for a call to consumePixmap() or consumeCustomData(int).

public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

formatback to summary
pack-priv int format
heightback to summary
pack-priv int height
internalFormatback to summary
pack-priv int internalFormat
isPreparedback to summary
pack-priv boolean isPrepared
mipLevelback to summary
pack-priv int mipLevel

properties of opengl texture

typeback to summary
pack-priv int type
widthback to summary
pack-priv int width

width and height

Constructor Detail

GLOnlyTextureDataback to summary
public GLOnlyTextureData(int width, int height, int mipMapLevel, int internalFormat, int format, int type)
Parameters
internalFormat:int

Specifies the internal format of the texture. Must be one of the following symbolic constants: GL20#GL_ALPHA, GL20#GL_LUMINANCE, GL20#GL_LUMINANCE_ALPHA, GL20#GL_RGB, GL20#GL_RGBA.

format:int

Specifies the format of the texel data. Must match internalformat. The following symbolic values are accepted: GL20#GL_ALPHA, GL20#GL_RGB, GL20#GL_RGBA, GL20#GL_LUMINANCE, and GL20#GL_LUMINANCE_ALPHA.

type:int

Specifies the data type of the texel data. The following symbolic values are accepted: GL20#GL_UNSIGNED_BYTE, GL20#GL_UNSIGNED_SHORT_5_6_5, GL20#GL_UNSIGNED_SHORT_4_4_4_4, and GL20#GL_UNSIGNED_SHORT_5_5_5_1.

See Also
https://www.khronos.org/opengles/sdk/docs/man/xhtml/glTexImage2D.xml

Method Detail

consumeCustomDataback to summary
public void consumeCustomData(int target)

Implements com.badlogic.gdx.graphics.TextureData.consumeCustomData.

Doc from com.badlogic.gdx.graphics.TextureData.consumeCustomData.

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
consumePixmapback to summary
public Pixmap consumePixmap()

Implements com.badlogic.gdx.graphics.TextureData.consumePixmap.

Doc from com.badlogic.gdx.graphics.TextureData.consumePixmap.

Returns the 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.

Annotations
@Override
disposePixmapback to summary
public boolean disposePixmap()

Implements com.badlogic.gdx.graphics.TextureData.disposePixmap.

Annotations
@Override
getFormatback to summary
public Pixmap.Format getFormat()

Implements com.badlogic.gdx.graphics.TextureData.getFormat.

Annotations
@Override
getHeightback to summary
public int getHeight()

Implements com.badlogic.gdx.graphics.TextureData.getHeight.

Annotations
@Override
getTypeback to summary
public TextureData.TextureDataType getType()

Implements com.badlogic.gdx.graphics.TextureData.getType.

Annotations
@Override
getWidthback to summary
public int getWidth()

Implements com.badlogic.gdx.graphics.TextureData.getWidth.

Annotations
@Override
isManagedback to summary
public boolean isManaged()

Implements com.badlogic.gdx.graphics.TextureData.isManaged.

Annotations
@Override
isPreparedback to summary
public boolean isPrepared()

Implements com.badlogic.gdx.graphics.TextureData.isPrepared.

Annotations
@Override
prepareback to summary
public void prepare()

Implements com.badlogic.gdx.graphics.TextureData.prepare.

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

Prepares the TextureData for a call to consumePixmap() or consumeCustomData(int). 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.TextureData.useMipMaps.

Annotations
@Override