Package arc.graphics.gl
Class FacedCubemapData
java.lang.Object
arc.graphics.gl.FacedCubemapData
- All Implemented Interfaces:
CubemapData
A FacedCubemapData holds a cubemap data definition based on a
TextureData
per face.-
Field Summary
-
Constructor Summary
ConstructorDescriptionConstruct an empty Cubemap.FacedCubemapData
(int width, int height, int depth, Pixmap.Format format) Construct a Cubemap withPixmap
s for each side of the specified size.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
(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
(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.FacedCubemapData
(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.FacedCubemapData
(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 TypeMethodDescriptionvoid
Uploads the pixel data for the 6 faces of the cube to the OpenGL ES texture.int
int
getWidth()
boolean
boolean
void
load
(Cubemap.CubemapSide side, Fi file) Loads the texture specified using theFi
and sets it to specified side, overwriting any previous data set to that side.void
load
(Cubemap.CubemapSide side, Pixmap pixmap) Sets the specified side of this cubemap to the specifiedPixmap
, overwriting any previous data set to that side.void
prepare()
Prepares the TextureData for a call toCubemapData.consumeCubemapData()
.
-
Field Details
-
data
-
-
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 specifiedPixmap
s 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 specifiedPixmap
s for the sides, optionally generating mipmaps. -
FacedCubemapData
Construct a Cubemap withPixmap
s 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 specifiedTextureData
's for the sides
-
-
Method Details
-
load
Loads the texture specified using theFi
and sets it to specified side, overwriting any previous data set to that side. Note that you need to reload throughCubemap.load(CubemapData)
any cubemap using this data for the change to be taken in account.- Parameters:
side
- TheCubemap.CubemapSide
file
- The textureFi
-
load
Sets the specified side of this cubemap to the specifiedPixmap
, overwriting any previous data set to that side. Note that you need to reload throughCubemap.load(CubemapData)
any cubemap using this data for the change to be taken in account.- Parameters:
side
- TheCubemap.CubemapSide
pixmap
- ThePixmap
-
isComplete
public boolean isComplete()- Returns:
- True if all sides of this cubemap are set, false otherwise.
-
getTextureData
- Returns:
- The
TextureData
for the specified side, can be null if the cubemap is incomplete.
-
getWidth
public int getWidth()- Specified by:
getWidth
in interfaceCubemapData
- Returns:
- the width of the pixel data
-
getHeight
public int getHeight()- Specified by:
getHeight
in interfaceCubemapData
- Returns:
- the height of the pixel data
-
isPrepared
public boolean isPrepared()- Specified by:
isPrepared
in interfaceCubemapData
- Returns:
- whether the TextureData is prepared or not.
-
prepare
public void prepare()Description copied from interface:CubemapData
Prepares the TextureData for a call toCubemapData.consumeCubemapData()
. This method can be called from a non OpenGL thread and should thus not interact with OpenGL.- Specified by:
prepare
in interfaceCubemapData
-
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 toCubemapData.prepare()
must preceed a call to this method. Any internal data structures created inCubemapData.prepare()
should be disposed of here.- Specified by:
consumeCubemapData
in interfaceCubemapData
-