Package WildMagic.LibGraphics.Rendering
Class Texture
- java.lang.Object
-
- WildMagic.LibGraphics.ObjectSystem.GraphicsObject
-
- WildMagic.LibGraphics.SceneGraph.Spatial
-
- WildMagic.LibGraphics.Rendering.Bindable
-
- WildMagic.LibGraphics.Rendering.Texture
-
- All Implemented Interfaces:
java.io.Serializable
,NameIdInterface
,StreamInterface
public class Texture extends Bindable implements StreamInterface, java.io.Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Texture.DepthCompare
Texture depth comparison types:static class
Texture.FilterType
Texture filter type:static class
Texture.Type
Type of Samplerstatic class
Texture.WrapType
Texture wrap type:-
Nested classes/interfaces inherited from class WildMagic.LibGraphics.Rendering.Bindable
Bindable.Info
-
Nested classes/interfaces inherited from class WildMagic.LibGraphics.SceneGraph.Spatial
Spatial.CullingMode
-
-
Field Summary
Fields Modifier and Type Field Description protected Texture.WrapType[]
m_aeWType
Default wrap types.protected boolean
m_bOffscreenTexture
Support for offscreen textures.protected Texture.DepthCompare
m_eCompare
Support for depth textures.protected Texture.FilterType
m_eFType
Default filter typeprivate Texture.Type
m_eType
Sampler type.protected ColorRGBA
m_kBorderColor
Default border color.protected GraphicsImage
m_spkImage
GraphicsImage texture data.private static Texture.DepthCompare
ms_eDepthCompareStatic
Initializes static enum for depth compare.private static Texture.FilterType
ms_eFilterTypeStatic
Initializes static enum for filter type.private static Texture.WrapType
ms_eWrapTypeStatic
Initializes static enum for wrap type.private static java.util.HashMap<java.lang.Integer,Texture.DepthCompare>
ms_pkDepthCompareMap
Maps depth compare enum to int values.private static java.util.HashMap<java.lang.Integer,Texture.FilterType>
ms_pkFilterTypeMap
Maps filter type enum to int values.private static java.util.HashMap<java.lang.Integer,Texture.WrapType>
ms_pkWrapTypeMap
Maps wrap type enum to int values.private static long
serialVersionUID
-
Fields inherited from class WildMagic.LibGraphics.Rendering.Bindable
m_bShared, m_kInfoArray
-
Fields inherited from class WildMagic.LibGraphics.SceneGraph.Spatial
Culling, Local, m_iStartEffect, m_kEffects, m_kGlobalStates, m_kLights, m_pkParent, World, WorldBound, WorldBoundIsCurrent, WorldIsCurrent
-
-
Constructor Summary
Constructors Constructor Description Texture()
Default constructor.Texture(GraphicsImage pkImage)
Construct a Texture object with the given GraphicsImage.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose(Renderer pkUser)
Release memory.ColorRGBA
GetBorderColor()
Access to the border color used for sampling outside the texture image.Texture.DepthCompare
GetDepthCompare()
Get depth compare type.int
GetDiskUsed(StreamVersion rkVersion)
Returns the size of this object and it's children on disk for the current StreamVersion parameter.Texture.FilterType
GetFilterType()
Fet filter modes.GraphicsImage
GetImage()
Get texture image.java.lang.String
GetName()
Get texture image name.Texture.Type
GetType()
Return type of sampler.Texture.WrapType
GetWrapType(int i)
Get to wrap modes.boolean
IsDepthTexture()
Support for depth textures.boolean
IsOffscreenTexture()
Support for offscreen textures.void
Load(Stream rkStream, Stream.Link pkLink)
Loads this object from the input parameter rkStream, using the input Stream.Link to store the IDs of children objects of this object for linking after all objects are loaded from the Stream.void
Save(Stream rkStream)
Write this object and all it's children to the Stream.StringTree
SaveStrings(java.lang.String acTitle)
Write this object into a StringTree for the scene-graph visualization.void
SetBorderColor(ColorRGBA rkBorderColor)
Access to the border color used for sampling outside the texture image.void
SetDepthCompare(Texture.DepthCompare eCompare)
Set depth compare type.void
SetFilterType(Texture.FilterType eFType)
Set filter modes.void
SetImage(GraphicsImage pkImage)
Set texture image.void
SetImage(GraphicsImage pkImage, Texture.Type eType)
Set texture image.void
SetOffscreenTexture(boolean bOffscreenTexture)
Set offscreen texture flag.void
SetWrapType(int i, Texture.WrapType eWType)
Set to wrap modes.-
Methods inherited from class WildMagic.LibGraphics.Rendering.Bindable
GetIdentifier, GetIdentifier, GetInfoQuantity, GetShared, GetVisibleSet, IsReload, IsReload, OnLoad, OnRelease, Release, Reload, Reload, Remove, SetShared, UpdateState, UpdateWorldBound
-
Methods inherited from class WildMagic.LibGraphics.SceneGraph.Spatial
AttachEffect, AttachGlobalState, AttachLight, DetachAllEffects, DetachAllGlobalStates, DetachAllLights, DetachEffect, DetachGlobalState, DetachLight, dispose, GetAllObjectsByName, GetEffect, GetEffectQuantity, GetGlobalState, GetGlobalState, GetGlobalStateQuantity, GetLight, GetLightQuantity, GetObjectByID, GetObjectByName, GetParent, GetStartEffect, Link, OnGetVisibleSet, PopState, PropagateBoundToRoot, PropagateStateFromRoot, PushState, Register, SetParent, SetStartEffect, UpdateBS, UpdateGS, UpdateGS, UpdateRS, UpdateRS, UpdateWorldData
-
Methods inherited from class WildMagic.LibGraphics.ObjectSystem.GraphicsObject
GetID, GetNextID, GetObjectByIDBase, GetObjectByNameBase, SetName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface WildMagic.LibGraphics.ObjectSystem.StreamInterface
Link, Register
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
ms_pkFilterTypeMap
private static java.util.HashMap<java.lang.Integer,Texture.FilterType> ms_pkFilterTypeMap
Maps filter type enum to int values.
-
ms_pkWrapTypeMap
private static java.util.HashMap<java.lang.Integer,Texture.WrapType> ms_pkWrapTypeMap
Maps wrap type enum to int values.
-
ms_pkDepthCompareMap
private static java.util.HashMap<java.lang.Integer,Texture.DepthCompare> ms_pkDepthCompareMap
Maps depth compare enum to int values.
-
ms_eFilterTypeStatic
private static Texture.FilterType ms_eFilterTypeStatic
Initializes static enum for filter type.
-
ms_eWrapTypeStatic
private static Texture.WrapType ms_eWrapTypeStatic
Initializes static enum for wrap type.
-
ms_eDepthCompareStatic
private static Texture.DepthCompare ms_eDepthCompareStatic
Initializes static enum for depth compare.
-
m_spkImage
protected GraphicsImage m_spkImage
GraphicsImage texture data.
-
m_eFType
protected Texture.FilterType m_eFType
Default filter type
-
m_aeWType
protected Texture.WrapType[] m_aeWType
Default wrap types.
-
m_kBorderColor
protected ColorRGBA m_kBorderColor
Default border color.
-
m_eCompare
protected Texture.DepthCompare m_eCompare
Support for depth textures. The default value is DC_QUANTITY, indicating that the texture is *not* a depth texture.
-
m_bOffscreenTexture
protected boolean m_bOffscreenTexture
Support for offscreen textures. The default value is 'false'.
-
m_eType
private Texture.Type m_eType
Sampler type.
-
-
Constructor Detail
-
Texture
public Texture()
Default constructor.
-
Texture
public Texture(GraphicsImage pkImage)
Construct a Texture object with the given GraphicsImage.- Parameters:
pkImage
- GraphicsImage associated with this Texture.
-
-
Method Detail
-
dispose
public void dispose(Renderer pkUser)
Release memory.
-
GetBorderColor
public final ColorRGBA GetBorderColor()
Access to the border color used for sampling outside the texture image. The default is ColorRGBA(0,0,0,1).- Returns:
- border color.
-
GetDepthCompare
public final Texture.DepthCompare GetDepthCompare()
Get depth compare type.- Returns:
- depth compare type.
-
GetDiskUsed
public int GetDiskUsed(StreamVersion rkVersion)
Returns the size of this object and it's children on disk for the current StreamVersion parameter.- Specified by:
GetDiskUsed
in interfaceStreamInterface
- Overrides:
GetDiskUsed
in classSpatial
- Parameters:
rkVersion
- the current version of the Stream file being created.- Returns:
- the size of this object on disk.
-
GetFilterType
public final Texture.FilterType GetFilterType()
Fet filter modes. The default is LINEAR.- Returns:
- filter type.
-
GetImage
public final GraphicsImage GetImage()
Get texture image.- Returns:
- GraphicsImage for this Texture.
-
GetName
public final java.lang.String GetName()
Get texture image name.- Overrides:
GetName
in classGraphicsObject
- Returns:
- String name for this Texture.
-
GetType
public final Texture.Type GetType()
Return type of sampler.- Returns:
- type of sampler.
-
GetWrapType
public Texture.WrapType GetWrapType(int i)
Get to wrap modes.- Parameters:
i
- must satisfy 0 <= i < GetDimension().- Returns:
- wrap type. The defaults are CLAMP_TO_EDGE.
-
IsDepthTexture
public final boolean IsDepthTexture()
Support for depth textures.- Returns:
- true if this is a depth texture.
-
IsOffscreenTexture
public final boolean IsOffscreenTexture()
Support for offscreen textures.- Returns:
- true it this is an offscreen texture.
-
Load
public void Load(Stream rkStream, Stream.Link pkLink)
Loads this object from the input parameter rkStream, using the input Stream.Link to store the IDs of children objects of this object for linking after all objects are loaded from the Stream.- Specified by:
Load
in interfaceStreamInterface
- Overrides:
Load
in classSpatial
- Parameters:
rkStream
- the Stream from which this object is being read.pkLink
- the Link class for storing the IDs of this object's children objects.
-
Save
public void Save(Stream rkStream)
Write this object and all it's children to the Stream.- Specified by:
Save
in interfaceStreamInterface
- Overrides:
Save
in classSpatial
- Parameters:
rkStream
- the Stream where the child objects are stored.
-
SaveStrings
public StringTree SaveStrings(java.lang.String acTitle)
Write this object into a StringTree for the scene-graph visualization.- Specified by:
SaveStrings
in interfaceStreamInterface
- Overrides:
SaveStrings
in classSpatial
- Parameters:
acTitle
- the header for this object in the StringTree.- Returns:
- StringTree containing a String-based representation of this object and it's children.
-
SetBorderColor
public void SetBorderColor(ColorRGBA rkBorderColor)
Access to the border color used for sampling outside the texture image. The default is ColorRGBA(0,0,0,1).- Parameters:
rkBorderColor
- new border color.
-
SetDepthCompare
public void SetDepthCompare(Texture.DepthCompare eCompare)
Set depth compare type.- Parameters:
eCompare
- new depth compare type.
-
SetFilterType
public void SetFilterType(Texture.FilterType eFType)
Set filter modes. The default is LINEAR.- Parameters:
eFType
- new filter type.
-
SetImage
public void SetImage(GraphicsImage pkImage)
Set texture image.- Parameters:
pkImage
- new GraphicsImage for this Texture.
-
SetImage
public void SetImage(GraphicsImage pkImage, Texture.Type eType)
Set texture image.- Parameters:
pkImage
- new GraphicsImage for this Texture.
-
SetOffscreenTexture
public void SetOffscreenTexture(boolean bOffscreenTexture)
Set offscreen texture flag.- Parameters:
bOffscreenTexture
- true sets this to an offscreen texture.
-
SetWrapType
public void SetWrapType(int i, Texture.WrapType eWType)
Set to wrap modes.- Parameters:
i
- must satisfy 0 <= i < GetDimension().eWType
- new wrap type. The defaults are CLAMP_TO_EDGE.
-
-