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

public Class Cubemap

extends GLTexture
Class Inheritance
Imports
java.util.HashMap, .Map, com.badlogic.gdx.Application, .Gdx, com.badlogic.gdx.assets.AssetLoaderParameters.LoadedCallback, .AssetManager, com.badlogic.gdx.assets.loaders.AssetLoader, .CubemapLoader.CubemapParameter, com.badlogic.gdx.files.FileHandle, com.badlogic.gdx.graphics.Pixmap.Format, com.badlogic.gdx.graphics.glutils.FacedCubemapData, .PixmapTextureData, com.badlogic.gdx.math.Vector3, com.badlogic.gdx.utils.Array, .GdxRuntimeException

Wraps a standard OpenGL ES Cubemap. Must be disposed when it is no longer used.
Author
Xoppa

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
Cubemap.CubemapSide

Enum to identify each side of a Cubemap

Field Summary

Modifier and TypeField and Description
private static AssetManager
protected CubemapData
pack-priv static final Map<Application, Array<Cubemap>>
Inherited from com.badlogic.gdx.graphics.GLTexture:
anisotropicFilterLevelglHandleglTargetmagFilterminFilteruWrapvWrap

Constructor Summary

AccessConstructor and Description
public
Cubemap(CubemapData data)

Construct a Cubemap based on the given CubemapData.

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

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

public
Cubemap(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
Cubemap(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
Cubemap(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
Cubemap(int width, int height, int depth, Pixmap.Format format)

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

public
Cubemap(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
private static void
public static void
clearAllCubemaps(Application app)

Clears all managed cubemaps.

public void
dispose()

Overrides com.badlogic.gdx.graphics.GLTexture.dispose.

Implements com.badlogic.gdx.utils.Disposable.dispose.

Disposes all resources associated with the cubemap

public CubemapData
public int
public int
public static String
public static int
getNumManagedCubemaps()

Returns: the number of managed cubemaps currently loaded

public int
public static void
invalidateAllCubemaps(Application app)

Invalidate all managed cubemaps.

public boolean
public void
load(CubemapData data)

Sets the sides of this cubemap to the specified CubemapData.

protected void
public static void
setAssetManager(AssetManager
the asset manager.
manager
)

Sets the AssetManager.

Inherited from com.badlogic.gdx.graphics.GLTexture:
bindbinddeletegetAnisotropicFiltergetMagFiltergetMaxAnisotropicFilterLevelgetMinFiltergetTextureObjectHandlegetUWrapgetVWrapsetAnisotropicFiltersetFiltersetWrapunsafeSetAnisotropicFilterunsafeSetAnisotropicFilterunsafeSetFilterunsafeSetFilterunsafeSetWrapunsafeSetWrapuploadImageDatauploadImageData

Field Detail

assetManagerback to summary
private static AssetManager assetManager
databack to summary
protected CubemapData data
managedCubemapsback to summary
pack-priv static final Map<Application, Array<Cubemap>> managedCubemaps

Constructor Detail

Cubemapback to summary
public Cubemap(CubemapData data)

Construct a Cubemap based on the given CubemapData.

Cubemapback to summary
public Cubemap(FileHandle positiveX, FileHandle negativeX, FileHandle positiveY, FileHandle negativeY, FileHandle positiveZ, FileHandle negativeZ)

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

Cubemapback to summary
public Cubemap(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.

Cubemapback to summary
public Cubemap(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.

Cubemapback to summary
public Cubemap(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.

Cubemapback to summary
public Cubemap(int width, int height, int depth, Pixmap.Format format)

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

Cubemapback to summary
public Cubemap(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

addManagedCubemapback to summary
private static void addManagedCubemap(Application app, Cubemap cubemap)
clearAllCubemapsback to summary
public static void clearAllCubemaps(Application app)

Clears all managed cubemaps. This is an internal method. Do not use it!

disposeback to summary
public void dispose()

Overrides com.badlogic.gdx.graphics.GLTexture.dispose.

Implements com.badlogic.gdx.utils.Disposable.dispose.

Disposes all resources associated with the cubemap

Annotations
@Override
getCubemapDataback to summary
public CubemapData getCubemapData()
getDepthback to summary
public int getDepth()

Implements abstract com.badlogic.gdx.graphics.GLTexture.getDepth.

Annotations
@Override
getHeightback to summary
public int getHeight()

Implements abstract com.badlogic.gdx.graphics.GLTexture.getHeight.

Annotations
@Override
getManagedStatusback to summary
public static String getManagedStatus()
getNumManagedCubemapsback to summary
public static int getNumManagedCubemaps()
Returns:int

the number of managed cubemaps currently loaded

getWidthback to summary
public int getWidth()

Implements abstract com.badlogic.gdx.graphics.GLTexture.getWidth.

Annotations
@Override
invalidateAllCubemapsback to summary
public static void invalidateAllCubemaps(Application app)

Invalidate all managed cubemaps. This is an internal method. Do not use it!

isManagedback to summary
public boolean isManaged()

Implements abstract com.badlogic.gdx.graphics.GLTexture.isManaged.

Annotations
@Override
loadback to summary
public void load(CubemapData data)

Sets the sides of this cubemap to the specified CubemapData.

reloadback to summary
protected void reload()

Implements abstract com.badlogic.gdx.graphics.GLTexture.reload.

Annotations
@Override
setAssetManagerback to summary
public static void setAssetManager(AssetManager manager)

Sets the AssetManager. When the context is lost, cubemaps managed by the asset manager are reloaded by the manager on a separate thread (provided that a suitable AssetLoader is registered with the manager). Cubemaps not managed by the AssetManager are reloaded via the usual means on the rendering thread.

Parameters
manager:AssetManager

the asset manager.

com.badlogic.gdx.graphics back to summary

public final Enum Cubemap.CubemapSide

extends Enum<Cubemap.CubemapSide>
Class Inheritance

Enum to identify each side of a Cubemap

Field Summary

Modifier and TypeField and Description
public final Vector3
direction

The direction vector to target the side.

public final int
glEnum

The OpenGL target (used for glTexImage2D) of the side.

public final int
index

The zero based index of the side in the cubemap

public static final Cubemap.CubemapSide
NegativeX

The negative X and second side of the cubemap

public static final Cubemap.CubemapSide
NegativeY

The negative Y and fourth side of the cubemap

public static final Cubemap.CubemapSide
NegativeZ

The negative Z and sixth side of the cubemap

public static final Cubemap.CubemapSide
PositiveX

The positive X and first side of the cubemap

public static final Cubemap.CubemapSide
PositiveY

The positive Y and third side of the cubemap

public static final Cubemap.CubemapSide
PositiveZ

The positive Z and fifth side of the cubemap

public final Vector3
up

The up vector to target the side.

Constructor Summary

AccessConstructor and Description
private
CubemapSide(int index, int glEnum, float upX, float upY, float upZ, float directionX, float directionY, float directionZ)

Method Summary

Modifier and TypeMethod and Description
public Vector3
getDirection(Vector3 out)

Returns: The direction vector of the side.

public int
getGLEnum()

Returns: The OpenGL target (used for glTexImage2D) of the side.

public Vector3
getUp(Vector3 out)

Returns: The up vector of the side.

public static Cubemap.CubemapSide
public static Cubemap.CubemapSide[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

directionback to summary
public final Vector3 direction

The direction vector to target the side.

glEnumback to summary
public final int glEnum

The OpenGL target (used for glTexImage2D) of the side.

indexback to summary
public final int index

The zero based index of the side in the cubemap

NegativeXback to summary
public static final Cubemap.CubemapSide NegativeX

The negative X and second side of the cubemap

NegativeYback to summary
public static final Cubemap.CubemapSide NegativeY

The negative Y and fourth side of the cubemap

NegativeZback to summary
public static final Cubemap.CubemapSide NegativeZ

The negative Z and sixth side of the cubemap

PositiveXback to summary
public static final Cubemap.CubemapSide PositiveX

The positive X and first side of the cubemap

PositiveYback to summary
public static final Cubemap.CubemapSide PositiveY

The positive Y and third side of the cubemap

PositiveZback to summary
public static final Cubemap.CubemapSide PositiveZ

The positive Z and fifth side of the cubemap

upback to summary
public final Vector3 up

The up vector to target the side.

Constructor Detail

CubemapSideback to summary
private CubemapSide(int index, int glEnum, float upX, float upY, float upZ, float directionX, float directionY, float directionZ)

Method Detail

getDirectionback to summary
public Vector3 getDirection(Vector3 out)
Returns:Vector3

The direction vector of the side.

getGLEnumback to summary
public int getGLEnum()
Returns:int

The OpenGL target (used for glTexImage2D) of the side.

getUpback to summary
public Vector3 getUp(Vector3 out)
Returns:Vector3

The up vector of the side.

valueOfback to summary
public static Cubemap.CubemapSide valueOf(String name)
valuesback to summary
public static Cubemap.CubemapSide[] values()