Class Texture

    • Field Detail

      • 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_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'.
    • 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 interface StreamInterface
        Overrides:
        GetDiskUsed in class Spatial
        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 class GraphicsObject
        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
        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 interface StreamInterface
        Overrides:
        Load in class Spatial
        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 interface StreamInterface
        Overrides:
        Save in class Spatial
        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 interface StreamInterface
        Overrides:
        SaveStrings in class Spatial
        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
        eWType - new wrap type. The defaults are CLAMP_TO_EDGE.