Package com.badlogic.gdx.graphics
Class Cubemap
- java.lang.Object
-
- com.badlogic.gdx.graphics.GLTexture
-
- com.badlogic.gdx.graphics.Cubemap
-
- All Implemented Interfaces:
Disposable
public class Cubemap extends GLTexture
Wraps a standard OpenGL ES Cubemap. Must be disposed when it is no longer used.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCubemap.CubemapSideEnum to identify each side of a Cubemap
-
Field Summary
Fields Modifier and Type Field Description protected CubemapDatadata
-
Constructor Summary
Constructors Constructor Description Cubemap(int width, int height, int depth, Pixmap.Format format)Construct a Cubemap withPixmaps for each side of the specified size.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.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.Cubemap(CubemapData data)Construct a Cubemap based on the given CubemapData.Cubemap(Pixmap positiveX, Pixmap negativeX, Pixmap positiveY, Pixmap negativeY, Pixmap positiveZ, Pixmap negativeZ)Construct a Cubemap with the specifiedPixmaps for the sides, does not generate mipmaps.Cubemap(Pixmap positiveX, Pixmap negativeX, Pixmap positiveY, Pixmap negativeY, Pixmap positiveZ, Pixmap negativeZ, boolean useMipMaps)Construct a Cubemap with the specifiedPixmaps for the sides, optionally generating mipmaps.Cubemap(TextureData positiveX, TextureData negativeX, TextureData positiveY, TextureData negativeY, TextureData positiveZ, TextureData negativeZ)Construct a Cubemap with the specifiedTextureData's for the sides
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidclearAllCubemaps(Application app)Clears all managed cubemaps.voiddispose()Disposes all resources associated with the cubemapCubemapDatagetCubemapData()intgetDepth()intgetHeight()static java.lang.StringgetManagedStatus()static intgetNumManagedCubemaps()intgetWidth()static voidinvalidateAllCubemaps(Application app)Invalidate all managed cubemaps.booleanisManaged()voidload(CubemapData data)Sets the sides of this cubemap to the specifiedCubemapData.protected voidreload()static voidsetAssetManager(AssetManager manager)Sets theAssetManager.-
Methods inherited from class com.badlogic.gdx.graphics.GLTexture
bind, bind, delete, getAnisotropicFilter, getMagFilter, getMaxAnisotropicFilterLevel, getMinFilter, getTextureObjectHandle, getUWrap, getVWrap, setAnisotropicFilter, setFilter, setWrap, unsafeSetAnisotropicFilter, unsafeSetAnisotropicFilter, unsafeSetFilter, unsafeSetFilter, unsafeSetWrap, unsafeSetWrap, uploadImageData, uploadImageData
-
-
-
-
Field Detail
-
data
protected CubemapData data
-
-
Constructor Detail
-
Cubemap
public Cubemap(CubemapData data)
Construct a Cubemap based on the given CubemapData.
-
Cubemap
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.
-
Cubemap
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.
-
Cubemap
public Cubemap(Pixmap positiveX, Pixmap negativeX, Pixmap positiveY, Pixmap negativeY, Pixmap positiveZ, Pixmap negativeZ)
Construct a Cubemap with the specifiedPixmaps for the sides, does not generate mipmaps.
-
Cubemap
public Cubemap(Pixmap positiveX, Pixmap negativeX, Pixmap positiveY, Pixmap negativeY, Pixmap positiveZ, Pixmap negativeZ, boolean useMipMaps)
Construct a Cubemap with the specifiedPixmaps for the sides, optionally generating mipmaps.
-
Cubemap
public Cubemap(int width, int height, int depth, Pixmap.Format format)Construct a Cubemap withPixmaps for each side of the specified size.
-
Cubemap
public Cubemap(TextureData positiveX, TextureData negativeX, TextureData positiveY, TextureData negativeY, TextureData positiveZ, TextureData negativeZ)
Construct a Cubemap with the specifiedTextureData's for the sides
-
-
Method Detail
-
load
public void load(CubemapData data)
Sets the sides of this cubemap to the specifiedCubemapData.
-
getCubemapData
public CubemapData getCubemapData()
-
isManaged
public boolean isManaged()
-
getWidth
public int getWidth()
-
getHeight
public int getHeight()
-
getDepth
public int getDepth()
-
dispose
public void dispose()
Disposes all resources associated with the cubemap- Specified by:
disposein interfaceDisposable- Overrides:
disposein classGLTexture
-
clearAllCubemaps
public static void clearAllCubemaps(Application app)
Clears all managed cubemaps. This is an internal method. Do not use it!
-
invalidateAllCubemaps
public static void invalidateAllCubemaps(Application app)
Invalidate all managed cubemaps. This is an internal method. Do not use it!
-
setAssetManager
public static void setAssetManager(AssetManager manager)
Sets theAssetManager. When the context is lost, cubemaps managed by the asset manager are reloaded by the manager on a separate thread (provided that a suitableAssetLoaderis registered with the manager). Cubemaps not managed by the AssetManager are reloaded via the usual means on the rendering thread.- Parameters:
manager- the asset manager.
-
getManagedStatus
public static java.lang.String getManagedStatus()
-
getNumManagedCubemaps
public static int getNumManagedCubemaps()
- Returns:
- the number of managed cubemaps currently loaded
-
-