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

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Enum to identify each side of a Cubemap
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected com.badlogic.gdx.graphics.CubemapData
     

    Fields inherited from class com.badlogic.gdx.graphics.GLTexture

    anisotropicFilterLevel, glHandle, glTarget, magFilter, minFilter, uWrap, vWrap
  • Constructor Summary

    Constructors
    Constructor
    Description
    OwnCubemap(int width, int height, int depth, com.badlogic.gdx.graphics.Pixmap.Format format)
    Construct a Cubemap with Pixmaps 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 specified Pixmaps 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 specified Pixmaps 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 specified TextureData's for the sides
    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 Summary

    Modifier and Type
    Method
    Description
    static void
    clearAllCubemaps(com.badlogic.gdx.Application app)
    Clears all managed cubemaps.
    void
    Disposes all resources associated with the cubemap
    com.badlogic.gdx.graphics.CubemapData
     
    int
     
    int
     
    static String
     
    static int
     
    int
     
    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 specified CubemapData.
    void
    load(com.badlogic.gdx.graphics.CubemapData data, com.badlogic.gdx.graphics.Texture.TextureFilter minFilter, com.badlogic.gdx.graphics.Texture.TextureFilter magFilter)
     
    protected void
     
    static void
    setAssetManager(com.badlogic.gdx.assets.AssetManager manager)
    Sets the AssetManager.

    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 specified Pixmaps 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 specified Pixmaps 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 with Pixmaps 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 specified TextureData'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 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 - the asset manager.
    • getManagedStatus

      public static String 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 specified CubemapData.
    • 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 class com.badlogic.gdx.graphics.GLTexture
    • reload

      protected void reload()
      Specified by:
      reload in class com.badlogic.gdx.graphics.GLTexture
    • getWidth

      public int getWidth()
      Specified by:
      getWidth in class com.badlogic.gdx.graphics.GLTexture
    • getHeight

      public int getHeight()
      Specified by:
      getHeight in class com.badlogic.gdx.graphics.GLTexture
    • getDepth

      public int getDepth()
      Specified by:
      getDepth in class com.badlogic.gdx.graphics.GLTexture
    • dispose

      public void dispose()
      Disposes all resources associated with the cubemap
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class com.badlogic.gdx.graphics.GLTexture