Package com.badlogic.gdx.graphics
Class Cubemap
java.lang.Object
com.badlogic.gdx.graphics.GLTexture
com.badlogic.gdx.graphics.Cubemap
- All Implemented Interfaces:
Disposable
Wraps a standard OpenGL ES Cubemap. Must be disposed when it is no longer used.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enum to identify each side of a Cubemap -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCubemap
(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
Modifier and TypeMethodDescriptionstatic void
Clears all managed cubemaps.void
dispose()
Disposes all resources associated with the cubemapint
getDepth()
int
static String
static int
int
getWidth()
static void
Invalidate all managed cubemaps.boolean
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 Details
-
data
-
-
Constructor Details
-
Cubemap
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
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 Details
-
load
Sets the sides of this cubemap to the specifiedCubemapData
. -
getCubemapData
-
isManaged
public boolean isManaged() -
reload
protected void reload() -
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
Clears all managed cubemaps. This is an internal method. Do not use it! -
invalidateAllCubemaps
Invalidate all managed cubemaps. This is an internal method. Do not use it! -
setAssetManager
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
-
getNumManagedCubemaps
public static int getNumManagedCubemaps()- Returns:
- the number of managed cubemaps currently loaded
-