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

public Class FacedCubemapData

extends Object
implements CubemapData
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.graphics.CubemapData
Imports
com.badlogic.gdx.Gdx, com.badlogic.gdx.files.FileHandle, com.badlogic.gdx.graphics.Cubemap, .Cubemap.CubemapSide, .CubemapData, .GL20, .Pixmap, .Pixmap.Blending, .Pixmap.Format, .TextureData, com.badlogic.gdx.utils.GdxRuntimeException

A FacedCubemapData holds a cubemap data definition based on a TextureData per face.
Author
Vincent Nousquet

Field Summary

Modifier and TypeField and Description
protected final TextureData[]

Constructor Summary

AccessConstructor and Description
public
FacedCubemapData()

Construct an empty Cubemap.

public
FacedCubemapData(FileHandle positiveX, FileHandle negativeX, FileHandle positiveY, FileHandle negativeY, FileHandle positiveZ, FileHandle negativeZ)

Construct a Cubemap with the specified texture files for the sides, optionally generating mipmaps.

public
FacedCubemapData(FileHandle positiveX, FileHandle negativeX, FileHandle positiveY, FileHandle negativeY, FileHandle positiveZ, FileHandle negativeZ, boolean useMipMaps)

Construct a Cubemap with the specified texture files for the sides, optionally generating mipmaps.

public
FacedCubemapData(Pixmap positiveX, Pixmap negativeX, Pixmap positiveY, Pixmap negativeY, Pixmap positiveZ, Pixmap negativeZ)

Construct a Cubemap with the specified Pixmaps for the sides, does not generate mipmaps.

public
FacedCubemapData(Pixmap positiveX, Pixmap negativeX, Pixmap positiveY, Pixmap negativeY, Pixmap positiveZ, Pixmap negativeZ, boolean useMipMaps)

Construct a Cubemap with the specified Pixmaps for the sides, optionally generating mipmaps.

public
FacedCubemapData(int width, int height, int depth, Pixmap.Format format)

Construct a Cubemap with Pixmaps for each side of the specified size.

public
FacedCubemapData(TextureData positiveX, TextureData negativeX, TextureData positiveY, TextureData negativeY, TextureData positiveZ, TextureData negativeZ)

Construct a Cubemap with the specified TextureData's for the sides

Method Summary

Modifier and TypeMethod and Description
public void
consumeCubemapData()

Implements com.badlogic.gdx.graphics.CubemapData.consumeCubemapData.

Uploads the pixel data for the 6 faces of the cube to the OpenGL ES texture.

public int
public TextureData
getTextureData(Cubemap.CubemapSide side)

Returns: The TextureData for the specified side, can be null if the cubemap is incomplete.

public int
public boolean
isComplete()

Returns: True if all sides of this cubemap are set, false otherwise.

public boolean
public boolean
public void
load(Cubemap.CubemapSide side, FileHandle
The texture FileHandle
file
)

Loads the texture specified using the FileHandle and sets it to specified side, overwriting any previous data set to that side.

public void
load(Cubemap.CubemapSide side, Pixmap
The Pixmap
pixmap
)

Sets the specified side of this cubemap to the specified Pixmap, overwriting any previous data set to that side.

public void
prepare()

Implements com.badlogic.gdx.graphics.CubemapData.prepare.

Prepares the TextureData for a call to consumeCubemapData().

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databack to summary
protected final TextureData[] data

Constructor Detail

FacedCubemapDataback to summary
public FacedCubemapData()

Construct an empty Cubemap. Use the load(...) methods to set the texture of each side. Every side of the cubemap must be set before it can be used.

FacedCubemapDataback to summary
public FacedCubemapData(FileHandle positiveX, FileHandle negativeX, FileHandle positiveY, FileHandle negativeY, FileHandle positiveZ, FileHandle negativeZ)

Construct a Cubemap with the specified texture files for the sides, optionally generating mipmaps.

FacedCubemapDataback to summary
public FacedCubemapData(FileHandle positiveX, FileHandle negativeX, FileHandle positiveY, FileHandle negativeY, FileHandle positiveZ, FileHandle negativeZ, boolean useMipMaps)

Construct a Cubemap with the specified texture files for the sides, optionally generating mipmaps.

FacedCubemapDataback to summary
public FacedCubemapData(Pixmap positiveX, Pixmap negativeX, Pixmap positiveY, Pixmap negativeY, Pixmap positiveZ, Pixmap negativeZ)

Construct a Cubemap with the specified Pixmaps for the sides, does not generate mipmaps.

FacedCubemapDataback to summary
public FacedCubemapData(Pixmap positiveX, Pixmap negativeX, Pixmap positiveY, Pixmap negativeY, Pixmap positiveZ, Pixmap negativeZ, boolean useMipMaps)

Construct a Cubemap with the specified Pixmaps for the sides, optionally generating mipmaps.

FacedCubemapDataback to summary
public FacedCubemapData(int width, int height, int depth, Pixmap.Format format)

Construct a Cubemap with Pixmaps for each side of the specified size.

FacedCubemapDataback to summary
public FacedCubemapData(TextureData positiveX, TextureData negativeX, TextureData positiveY, TextureData negativeY, TextureData positiveZ, TextureData negativeZ)

Construct a Cubemap with the specified TextureData's for the sides

Method Detail

consumeCubemapDataback to summary
public void consumeCubemapData()

Implements com.badlogic.gdx.graphics.CubemapData.consumeCubemapData.

Doc from com.badlogic.gdx.graphics.CubemapData.consumeCubemapData.

Uploads the pixel data for the 6 faces of the cube 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
getHeightback to summary
public int getHeight()

Implements com.badlogic.gdx.graphics.CubemapData.getHeight.

Annotations
@Override
getTextureDataback to summary
public TextureData getTextureData(Cubemap.CubemapSide side)
Returns:TextureData

The TextureData for the specified side, can be null if the cubemap is incomplete.

getWidthback to summary
public int getWidth()

Implements com.badlogic.gdx.graphics.CubemapData.getWidth.

Annotations
@Override
isCompleteback to summary
public boolean isComplete()
Returns:boolean

True if all sides of this cubemap are set, false otherwise.

isManagedback to summary
public boolean isManaged()

Implements com.badlogic.gdx.graphics.CubemapData.isManaged.

Annotations
@Override
isPreparedback to summary
public boolean isPrepared()

Implements com.badlogic.gdx.graphics.CubemapData.isPrepared.

Annotations
@Override
loadback to summary
public void load(Cubemap.CubemapSide side, FileHandle file)

Loads the texture specified using the FileHandle and sets it to specified side, overwriting any previous data set to that side. Note that you need to reload through Cubemap#load(CubemapData) any cubemap using this data for the change to be taken in account.

Parameters
side:Cubemap.CubemapSide

The CubemapSide

file:FileHandle

The texture FileHandle

loadback to summary
public void load(Cubemap.CubemapSide side, Pixmap pixmap)

Sets the specified side of this cubemap to the specified Pixmap, overwriting any previous data set to that side. Note that you need to reload through Cubemap#load(CubemapData) any cubemap using this data for the change to be taken in account.

Parameters
side:Cubemap.CubemapSide

The CubemapSide

pixmap:Pixmap

The Pixmap

prepareback to summary
public void prepare()

Implements com.badlogic.gdx.graphics.CubemapData.prepare.

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

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

Annotations
@Override