Package gaiasky.util.gdx
Class OwnCubemap
java.lang.Object
com.badlogic.gdx.graphics.GLTexture
gaiasky.util.gdx.OwnCubemap
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
public class OwnCubemap
extends com.badlogic.gdx.graphics.GLTexture
Wraps a standard OpenGL ES Cubemap. Must be disposed when it is no longer used.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Enum to identify each side of a Cubemap -
Field Summary
Fields inherited from class com.badlogic.gdx.graphics.GLTexture
anisotropicFilterLevel, glHandle, glTarget, magFilter, minFilter, uWrap, vWrap
-
Constructor Summary
ConstructorDescriptionOwnCubemap
(int width, int height, int depth, com.badlogic.gdx.graphics.Pixmap.Format format) Construct a Cubemap withPixmap
s for each side of the specified size.OwnCubemap
(com.badlogic.gdx.files.FileHandle positiveX, com.badlogic.gdx.files.FileHandle negativeX, com.badlogic.gdx.files.FileHandle positiveY, com.badlogic.gdx.files.FileHandle negativeY, com.badlogic.gdx.files.FileHandle positiveZ, com.badlogic.gdx.files.FileHandle negativeZ) Construct a Cubemap with the specified texture files for the sides, does not generate mipmaps.OwnCubemap
(com.badlogic.gdx.files.FileHandle positiveX, com.badlogic.gdx.files.FileHandle negativeX, com.badlogic.gdx.files.FileHandle positiveY, com.badlogic.gdx.files.FileHandle negativeY, com.badlogic.gdx.files.FileHandle positiveZ, com.badlogic.gdx.files.FileHandle negativeZ, boolean useMipMaps) Construct a Cubemap with the specified texture files for the sides, optionally generating mipmaps.OwnCubemap
(com.badlogic.gdx.graphics.CubemapData data) Construct a Cubemap based on the given CubemapData.OwnCubemap
(com.badlogic.gdx.graphics.CubemapData data, com.badlogic.gdx.graphics.Texture.TextureFilter minFilter, com.badlogic.gdx.graphics.Texture.TextureFilter magFilter) OwnCubemap
(com.badlogic.gdx.graphics.Pixmap positiveX, com.badlogic.gdx.graphics.Pixmap negativeX, com.badlogic.gdx.graphics.Pixmap positiveY, com.badlogic.gdx.graphics.Pixmap negativeY, com.badlogic.gdx.graphics.Pixmap positiveZ, com.badlogic.gdx.graphics.Pixmap negativeZ) Construct a Cubemap with the specifiedPixmap
s for the sides, does not generate mipmaps.OwnCubemap
(com.badlogic.gdx.graphics.Pixmap positiveX, com.badlogic.gdx.graphics.Pixmap negativeX, com.badlogic.gdx.graphics.Pixmap positiveY, com.badlogic.gdx.graphics.Pixmap negativeY, com.badlogic.gdx.graphics.Pixmap positiveZ, com.badlogic.gdx.graphics.Pixmap negativeZ, boolean useMipMaps) Construct a Cubemap with the specifiedPixmap
s for the sides, optionally generating mipmaps.OwnCubemap
(com.badlogic.gdx.graphics.TextureData positiveX, com.badlogic.gdx.graphics.TextureData negativeX, com.badlogic.gdx.graphics.TextureData positiveY, com.badlogic.gdx.graphics.TextureData negativeY, com.badlogic.gdx.graphics.TextureData positiveZ, com.badlogic.gdx.graphics.TextureData negativeZ) Construct a Cubemap with the specifiedTextureData
's for the sidesOwnCubemap
(com.badlogic.gdx.graphics.TextureData positiveX, com.badlogic.gdx.graphics.TextureData negativeX, com.badlogic.gdx.graphics.TextureData positiveY, com.badlogic.gdx.graphics.TextureData negativeY, com.badlogic.gdx.graphics.TextureData positiveZ, com.badlogic.gdx.graphics.TextureData negativeZ, com.badlogic.gdx.graphics.Texture.TextureFilter minFilter, com.badlogic.gdx.graphics.Texture.TextureFilter magFilter) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
clearAllCubemaps
(com.badlogic.gdx.Application app) Clears all managed cubemaps.void
dispose()
Disposes all resources associated with the cubemapcom.badlogic.gdx.graphics.CubemapData
int
getDepth()
int
static String
static int
int
getWidth()
static void
invalidateAllCubemaps
(com.badlogic.gdx.Application app) Invalidate all managed cubemaps.boolean
void
load
(com.badlogic.gdx.graphics.CubemapData data) Sets the sides of this cubemap to the specifiedCubemapData
.void
load
(com.badlogic.gdx.graphics.CubemapData data, com.badlogic.gdx.graphics.Texture.TextureFilter minFilter, com.badlogic.gdx.graphics.Texture.TextureFilter magFilter) protected void
reload()
static void
setAssetManager
(com.badlogic.gdx.assets.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
protected com.badlogic.gdx.graphics.CubemapData data
-
-
Constructor Details
-
OwnCubemap
public OwnCubemap(com.badlogic.gdx.graphics.CubemapData data) Construct a Cubemap based on the given CubemapData. -
OwnCubemap
public OwnCubemap(com.badlogic.gdx.graphics.CubemapData data, com.badlogic.gdx.graphics.Texture.TextureFilter minFilter, com.badlogic.gdx.graphics.Texture.TextureFilter magFilter) -
OwnCubemap
public OwnCubemap(com.badlogic.gdx.files.FileHandle positiveX, com.badlogic.gdx.files.FileHandle negativeX, com.badlogic.gdx.files.FileHandle positiveY, com.badlogic.gdx.files.FileHandle negativeY, com.badlogic.gdx.files.FileHandle positiveZ, com.badlogic.gdx.files.FileHandle negativeZ) Construct a Cubemap with the specified texture files for the sides, does not generate mipmaps. -
OwnCubemap
public OwnCubemap(com.badlogic.gdx.files.FileHandle positiveX, com.badlogic.gdx.files.FileHandle negativeX, com.badlogic.gdx.files.FileHandle positiveY, com.badlogic.gdx.files.FileHandle negativeY, com.badlogic.gdx.files.FileHandle positiveZ, com.badlogic.gdx.files.FileHandle negativeZ, boolean useMipMaps) Construct a Cubemap with the specified texture files for the sides, optionally generating mipmaps. -
OwnCubemap
public OwnCubemap(com.badlogic.gdx.graphics.Pixmap positiveX, com.badlogic.gdx.graphics.Pixmap negativeX, com.badlogic.gdx.graphics.Pixmap positiveY, com.badlogic.gdx.graphics.Pixmap negativeY, com.badlogic.gdx.graphics.Pixmap positiveZ, com.badlogic.gdx.graphics.Pixmap negativeZ) Construct a Cubemap with the specifiedPixmap
s for the sides, does not generate mipmaps. -
OwnCubemap
public OwnCubemap(com.badlogic.gdx.graphics.Pixmap positiveX, com.badlogic.gdx.graphics.Pixmap negativeX, com.badlogic.gdx.graphics.Pixmap positiveY, com.badlogic.gdx.graphics.Pixmap negativeY, com.badlogic.gdx.graphics.Pixmap positiveZ, com.badlogic.gdx.graphics.Pixmap negativeZ, boolean useMipMaps) Construct a Cubemap with the specifiedPixmap
s for the sides, optionally generating mipmaps. -
OwnCubemap
public OwnCubemap(int width, int height, int depth, com.badlogic.gdx.graphics.Pixmap.Format format) Construct a Cubemap withPixmap
s for each side of the specified size. -
OwnCubemap
public OwnCubemap(com.badlogic.gdx.graphics.TextureData positiveX, com.badlogic.gdx.graphics.TextureData negativeX, com.badlogic.gdx.graphics.TextureData positiveY, com.badlogic.gdx.graphics.TextureData negativeY, com.badlogic.gdx.graphics.TextureData positiveZ, com.badlogic.gdx.graphics.TextureData negativeZ) Construct a Cubemap with the specifiedTextureData
's for the sides -
OwnCubemap
public OwnCubemap(com.badlogic.gdx.graphics.TextureData positiveX, com.badlogic.gdx.graphics.TextureData negativeX, com.badlogic.gdx.graphics.TextureData positiveY, com.badlogic.gdx.graphics.TextureData negativeY, com.badlogic.gdx.graphics.TextureData positiveZ, com.badlogic.gdx.graphics.TextureData negativeZ, com.badlogic.gdx.graphics.Texture.TextureFilter minFilter, com.badlogic.gdx.graphics.Texture.TextureFilter magFilter)
-
-
Method Details
-
clearAllCubemaps
public static void clearAllCubemaps(com.badlogic.gdx.Application app) Clears all managed cubemaps. This is an internal method. Do not use it! -
invalidateAllCubemaps
public static void invalidateAllCubemaps(com.badlogic.gdx.Application app) Invalidate all managed cubemaps. This is an internal method. Do not use it! -
setAssetManager
public static void setAssetManager(com.badlogic.gdx.assets.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
-
getNumManagedCubemaps
public static int getNumManagedCubemaps()- Returns:
- the number of managed cubemaps currently loaded
-
load
public void load(com.badlogic.gdx.graphics.CubemapData data) Sets the sides of this cubemap to the specifiedCubemapData
. -
load
public void load(com.badlogic.gdx.graphics.CubemapData data, com.badlogic.gdx.graphics.Texture.TextureFilter minFilter, com.badlogic.gdx.graphics.Texture.TextureFilter magFilter) -
getCubemapData
public com.badlogic.gdx.graphics.CubemapData getCubemapData() -
isManaged
public boolean isManaged()- Specified by:
isManaged
in classcom.badlogic.gdx.graphics.GLTexture
-
reload
protected void reload()- Specified by:
reload
in classcom.badlogic.gdx.graphics.GLTexture
-
getWidth
public int getWidth()- Specified by:
getWidth
in classcom.badlogic.gdx.graphics.GLTexture
-
getHeight
public int getHeight()- Specified by:
getHeight
in classcom.badlogic.gdx.graphics.GLTexture
-
getDepth
public int getDepth()- Specified by:
getDepth
in classcom.badlogic.gdx.graphics.GLTexture
-
dispose
public void dispose()Disposes all resources associated with the cubemap- Specified by:
dispose
in interfacecom.badlogic.gdx.utils.Disposable
- Overrides:
dispose
in classcom.badlogic.gdx.graphics.GLTexture
-