Class FacedCubemapData

java.lang.Object
arc.graphics.gl.FacedCubemapData
All Implemented Interfaces:
CubemapData

public class FacedCubemapData extends Object implements CubemapData
A FacedCubemapData holds a cubemap data definition based on a TextureData per face.
  • Field Details

  • Constructor Details

    • FacedCubemapData

      public FacedCubemapData()
      Construct an empty Cubemap. Use the load(...) methods to set the texture of each side. Every side of the cubemap must be set before it can be used.
    • FacedCubemapData

      public FacedCubemapData(Fi positiveX, Fi negativeX, Fi positiveY, Fi negativeY, Fi positiveZ, Fi negativeZ)
      Construct a Cubemap with the specified texture files for the sides, optionally generating mipmaps.
    • FacedCubemapData

      public FacedCubemapData(Fi positiveX, Fi negativeX, Fi positiveY, Fi negativeY, Fi positiveZ, Fi negativeZ, boolean useMipMaps)
      Construct a Cubemap with the specified texture files for the sides, optionally generating mipmaps.
    • FacedCubemapData

      public FacedCubemapData(Pixmap positiveX, Pixmap negativeX, Pixmap positiveY, Pixmap negativeY, Pixmap positiveZ, Pixmap negativeZ)
      Construct a Cubemap with the specified Pixmaps for the sides, does not generate mipmaps.
    • FacedCubemapData

      public FacedCubemapData(Pixmap positiveX, Pixmap negativeX, Pixmap positiveY, Pixmap negativeY, Pixmap positiveZ, Pixmap negativeZ, boolean useMipMaps)
      Construct a Cubemap with the specified Pixmaps for the sides, optionally generating mipmaps.
    • FacedCubemapData

      public FacedCubemapData(int width, int height, int depth, Pixmap.Format format)
      Construct a Cubemap with Pixmaps for each side of the specified size.
    • FacedCubemapData

      public FacedCubemapData(TextureData positiveX, TextureData negativeX, TextureData positiveY, TextureData negativeY, TextureData positiveZ, TextureData negativeZ)
      Construct a Cubemap with the specified TextureData's for the sides
  • Method Details

    • load

      public void load(Cubemap.CubemapSide side, Fi file)
      Loads the texture specified using the Fi and sets it to specified side, overwriting any previous data set to that side. Note that you need to reload through Cubemap.load(CubemapData) any cubemap using this data for the change to be taken in account.
      Parameters:
      side - The Cubemap.CubemapSide
      file - The texture Fi
    • load

      public void load(Cubemap.CubemapSide side, Pixmap pixmap)
      Sets the specified side of this cubemap to the specified Pixmap, overwriting any previous data set to that side. Note that you need to reload through Cubemap.load(CubemapData) any cubemap using this data for the change to be taken in account.
      Parameters:
      side - The Cubemap.CubemapSide
      pixmap - The Pixmap
    • isComplete

      public boolean isComplete()
      Returns:
      True if all sides of this cubemap are set, false otherwise.
    • getTextureData

      public TextureData getTextureData(Cubemap.CubemapSide side)
      Returns:
      The TextureData for the specified side, can be null if the cubemap is incomplete.
    • getWidth

      public int getWidth()
      Specified by:
      getWidth in interface CubemapData
      Returns:
      the width of the pixel data
    • getHeight

      public int getHeight()
      Specified by:
      getHeight in interface CubemapData
      Returns:
      the height of the pixel data
    • isPrepared

      public boolean isPrepared()
      Specified by:
      isPrepared in interface CubemapData
      Returns:
      whether the TextureData is prepared or not.
    • prepare

      public void prepare()
      Description copied from interface: CubemapData
      Prepares the TextureData for a call to CubemapData.consumeCubemapData(). This method can be called from a non OpenGL thread and should thus not interact with OpenGL.
      Specified by:
      prepare in interface CubemapData
    • consumeCubemapData

      public void consumeCubemapData()
      Description copied from interface: CubemapData
      Uploads the pixel data for the 6 faces of the cube to the OpenGL ES texture. The caller must bind an OpenGL ES texture. A call to CubemapData.prepare() must preceed a call to this method. Any internal data structures created in CubemapData.prepare() should be disposed of here.
      Specified by:
      consumeCubemapData in interface CubemapData