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 classTexture.DepthCompareTexture depth comparison types:static classTexture.FilterTypeTexture filter type:static classTexture.TypeType of Samplerstatic classTexture.WrapTypeTexture 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_aeWTypeDefault wrap types.protected booleanm_bOffscreenTextureSupport for offscreen textures.protected Texture.DepthComparem_eCompareSupport for depth textures.protected Texture.FilterTypem_eFTypeDefault filter typeprivate Texture.Typem_eTypeSampler type.protected ColorRGBAm_kBorderColorDefault border color.protected GraphicsImagem_spkImageGraphicsImage texture data.private static Texture.DepthComparems_eDepthCompareStaticInitializes static enum for depth compare.private static Texture.FilterTypems_eFilterTypeStaticInitializes static enum for filter type.private static Texture.WrapTypems_eWrapTypeStaticInitializes static enum for wrap type.private static java.util.HashMap<java.lang.Integer,Texture.DepthCompare>ms_pkDepthCompareMapMaps depth compare enum to int values.private static java.util.HashMap<java.lang.Integer,Texture.FilterType>ms_pkFilterTypeMapMaps filter type enum to int values.private static java.util.HashMap<java.lang.Integer,Texture.WrapType>ms_pkWrapTypeMapMaps wrap type enum to int values.private static longserialVersionUID-
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 voiddispose(Renderer pkUser)Release memory.ColorRGBAGetBorderColor()Access to the border color used for sampling outside the texture image.Texture.DepthCompareGetDepthCompare()Get depth compare type.intGetDiskUsed(StreamVersion rkVersion)Returns the size of this object and it's children on disk for the current StreamVersion parameter.Texture.FilterTypeGetFilterType()Fet filter modes.GraphicsImageGetImage()Get texture image.java.lang.StringGetName()Get texture image name.Texture.TypeGetType()Return type of sampler.Texture.WrapTypeGetWrapType(int i)Get to wrap modes.booleanIsDepthTexture()Support for depth textures.booleanIsOffscreenTexture()Support for offscreen textures.voidLoad(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.voidSave(Stream rkStream)Write this object and all it's children to the Stream.StringTreeSaveStrings(java.lang.String acTitle)Write this object into a StringTree for the scene-graph visualization.voidSetBorderColor(ColorRGBA rkBorderColor)Access to the border color used for sampling outside the texture image.voidSetDepthCompare(Texture.DepthCompare eCompare)Set depth compare type.voidSetFilterType(Texture.FilterType eFType)Set filter modes.voidSetImage(GraphicsImage pkImage)Set texture image.voidSetImage(GraphicsImage pkImage, Texture.Type eType)Set texture image.voidSetOffscreenTexture(boolean bOffscreenTexture)Set offscreen texture flag.voidSetWrapType(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:
GetDiskUsedin interfaceStreamInterface- Overrides:
GetDiskUsedin 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:
GetNamein 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:
Loadin interfaceStreamInterface- Overrides:
Loadin 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:
Savein interfaceStreamInterface- Overrides:
Savein 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:
SaveStringsin interfaceStreamInterface- Overrides:
SaveStringsin 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.
-
-