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 class
Cubemap.CubemapSide
Enum to identify each side of a Cubemap
-
Field Summary
Fields Modifier and Type Field Description protected CubemapData
data
-
Constructor Summary
Constructors Constructor Description Cubemap(int width, int height, int depth, Pixmap.Format format)
Construct a Cubemap withPixmap
s 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 specifiedPixmap
s 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 specifiedPixmap
s 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 void
clearAllCubemaps(Application app)
Clears all managed cubemaps.void
dispose()
Disposes all resources associated with the cubemapCubemapData
getCubemapData()
int
getDepth()
int
getHeight()
static java.lang.String
getManagedStatus()
static int
getNumManagedCubemaps()
int
getWidth()
static void
invalidateAllCubemaps(Application app)
Invalidate all managed cubemaps.boolean
isManaged()
void
load(CubemapData data)
Sets the sides of this cubemap to the specifiedCubemapData
.protected void
reload()
static void
setAssetManager(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 specifiedPixmap
s 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 specifiedPixmap
s for the sides, optionally generating mipmaps.
-
Cubemap
public Cubemap(int width, int height, int depth, Pixmap.Format format)
Construct a Cubemap withPixmap
s 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:
dispose
in interfaceDisposable
- Overrides:
dispose
in 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 suitableAssetLoader
is 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
-
-