The ITexture graph node interface. More...
#include "murl_graph_i_texture.h"
Public Member Functions | |
virtual INode * | GetNodeInterface ()=0 |
Get the mutable Graph::INode interface. More... | |
virtual const INode * | GetNodeInterface () const =0 |
Get the constant Graph::INode interface. More... | |
virtual ITextureNodeTarget * | GetSubTextureNodeTarget ()=0 |
Get the mutable container holding the optional child textures. More... | |
virtual const ITextureNodeTarget * | GetSubTextureNodeTarget () const =0 |
Get the constant container holding the optional child textures. More... | |
virtual IImageResourceTarget * | GetImageResourceTarget ()=0 |
Get a mutable Graph::IImageResourceTarget container. More... | |
virtual const IImageResourceTarget * | GetImageResourceTarget () const =0 |
Get a constant Graph::IImageResourceTarget container. More... | |
virtual Bool | SetVideoStream (IEnums::TextureTarget target, UInt32 layer, IVideoStream *stream)=0 |
Manually set a video stream for a given layer and target. More... | |
virtual Bool | SetVideoStream (IEnums::TextureTarget target, IVideoStream *stream)=0 |
Manually set a video stream for layer 0 and a given target. More... | |
virtual IVideoStream * | GetVideoStream (IEnums::TextureTarget target, UInt32 layer) const =0 |
Get the video stream for a given layer and target. More... | |
virtual IVideoStream * | GetVideoStream (IEnums::TextureTarget target) const =0 |
Get the video stream for layer 0 and a given target. More... | |
virtual Bool | SetType (IEnums::TextureType type)=0 |
Set the texture type. More... | |
virtual IEnums::TextureType | GetType () const =0 |
Get the texture type. More... | |
virtual Bool | SetNumberOfLayers (UInt32 numLayers)=0 |
Set the number of texture layers. More... | |
virtual UInt32 | GetNumberOfLayers () const =0 |
Get the number of texture layers. More... | |
virtual Bool | SetMipMapGenerationMode (IEnums::MipMapGenerationMode mode)=0 |
Set the MIP map generation mode. More... | |
virtual IEnums::MipMapGenerationMode | GetMipMapGenerationMode () const =0 |
Get the texture type. More... | |
virtual Bool | SetSize (UInt32 sizeX, UInt32 sizeY)=0 |
Set the texure's dimensions. More... | |
virtual UInt32 | GetSizeX () const =0 |
Get the texture's base width. More... | |
virtual UInt32 | GetSizeY () const =0 |
Get the texture's base height. More... | |
virtual Bool | SetAutoScaleFactor (Real scaleX, Real scaleY)=0 |
Set the texure's auto scale factors. More... | |
virtual Real | GetAutoScaleFactorX () const =0 |
Get the texture's width. More... | |
virtual Real | GetAutoScaleFactorY () const =0 |
Get the texture's height. More... | |
virtual Bool | SetAlphaEnabled (Bool enabled)=0 |
Enable/disable the alpha channel for this texture. More... | |
virtual Bool | IsAlphaEnabled () const =0 |
Check if the alpha channel is enabled for this texture. More... | |
virtual Bool | SetMipMappingEnabled (Bool enabled)=0 |
Enable/disable mip-mapping for this texture. More... | |
virtual Bool | IsMipMappingEnabled () const =0 |
Check if mip-mapping is enabled for this texture. More... | |
virtual Bool | SetPrescalingEnabled (Bool enabled)=0 |
Enable/disable prescaling for this texture. More... | |
virtual Bool | IsPrescalingEnabled () const =0 |
Check if prescaling is enabled for this texture. More... | |
virtual Bool | SetPixelFormat (IEnums::PixelFormat pixelFormat)=0 |
Set the texture's actual pixel format. More... | |
virtual IEnums::PixelFormat | GetPixelFormat () const =0 |
Get the texture's actual pixel format. More... | |
virtual Bool | SetWrapModeX (IEnums::TextureWrapMode mode)=0 |
Set the texture's wrap mode in X direction. More... | |
virtual IEnums::TextureWrapMode | GetWrapModeX () const =0 |
Get the texture's wrap mode in X direction. More... | |
virtual Bool | SetWrapModeY (IEnums::TextureWrapMode mode)=0 |
Set the texture's wrap mode in Y direction. More... | |
virtual IEnums::TextureWrapMode | GetWrapModeY () const =0 |
Get the texture's wrap mode in Y direction. More... | |
virtual Bool | SetWrapModeZ (IEnums::TextureWrapMode mode)=0 |
Set the texture's wrap mode in Z direction. More... | |
virtual IEnums::TextureWrapMode | GetWrapModeZ () const =0 |
Get the texture's wrap mode in Z direction. More... | |
virtual Bool | SetMagFilter (IEnums::TextureFilter magFilter)=0 |
Set the texture filter used for magnification. More... | |
virtual IEnums::TextureFilter | GetMagFilter () const =0 |
Get the texture filter used for magnification. More... | |
virtual Bool | SetMinFilter (IEnums::TextureFilter minFilter)=0 |
Set the texture filter used for minification. More... | |
virtual IEnums::TextureFilter | GetMinFilter () const =0 |
Get the texture filter used for minification. More... | |
virtual Bool | SetMipFilter (IEnums::TextureFilter mipFilter)=0 |
Set the texture filter used for mip-level selection. More... | |
virtual IEnums::TextureFilter | GetMipFilter () const =0 |
Get the texture filter used for mip-level selection. More... | |
virtual Bool | SetDepthTestMode (IEnums::DepthTestMode mode)=0 |
Set the depth compare mode, if the pixel format defines a depth texture. More... | |
virtual IEnums::DepthTestMode | GetDepthTestMode () const =0 |
Get the depth compare mode. More... | |
virtual Bool | SetDepthTestFunction (IEnums::DepthTestFunction function)=0 |
Set the depth test function, if the pixel format defines a depth texture and the depth compare mode is not NONE. More... | |
virtual IEnums::DepthTestFunction | GetDepthTestFunction () const =0 |
Get the depth test function. More... | |
virtual Bool | SetMaxAnisotropy (Real maxAnisotropy)=0 |
Set the maximum anisotropy for filtering. More... | |
virtual Real | GetMaxAnisotropy () const =0 |
Set the maximum anisotropy for filtering. More... | |
virtual UInt32 | GetNumberOfDetailLevels () const =0 |
Get the texture's number of detail levels. More... | |
virtual UInt32 | GetNumberOfStages (UInt32 detailLevel) const =0 |
Get the texture's number of stages for a given detail level. More... | |
virtual Video::ITexture * | GetVideoTextureObject (UInt32 detailLevel, UInt32 stage) const =0 |
Get the texture's internal video renderer object for a given pass. More... | |
Public Member Functions inherited from Murl::Graph::IStateSlot | |
virtual Bool | SetSlot (SInt32 slot)=0 |
Set the slot index to use. More... | |
virtual SInt32 | GetSlot () const =0 |
Get the slot index to use. More... | |
Public Member Functions inherited from Murl::Graph::IStateUnit | |
virtual Bool | SetUnit (UInt32 unit)=0 |
Set the unit index to use. More... | |
virtual UInt32 | GetUnit () const =0 |
Get the unit index to use. More... | |
Detailed Description
The ITexture graph node interface.
This interface represents a generic node representing a texture for rendering.
Member Function Documentation
◆ GetNodeInterface() [1/2]
|
pure virtual |
Get the mutable Graph::INode interface.
This method returns a mutable pointer to the node's Graph::INode interface, to be able to query or modify common node properties such as active state, visibility or ID.
- Returns
- The mutable Graph::INode interface, or null if not available
◆ GetNodeInterface() [2/2]
|
pure virtual |
Get the constant Graph::INode interface.
This method returns a constant pointer to the node's Graph::INode interface, to be able to query common node properties such as active state, visibility or ID.
- Returns
- The constant Graph::INode interface, or null if not available
◆ GetSubTextureNodeTarget() [1/2]
|
pure virtual |
Get the mutable container holding the optional child textures.
This method returns a mutable pointer to the node's Graph::ITextureNodeTarget sub container, which is used to store multiple sub-textures.
- Returns
- The mutable Graph::ITextureNodeTarget container, or null if not available.
◆ GetSubTextureNodeTarget() [2/2]
|
pure virtual |
Get the constant container holding the optional child textures.
This method returns a constant pointer to the node's Graph::ITextureNodeTarget sub container, which is used to store multiple sub-textures.
- Returns
- The constant Graph::ITextureNodeTarget container, or null if not available.
◆ GetImageResourceTarget() [1/2]
|
pure virtual |
Get a mutable Graph::IImageResourceTarget container.
This method returns a mutable pointer to a Graph::IImageResourceTarget container, which allows to add, remove or query the image resources referenced by a node implementing this interface.
- Returns
- The mutable Graph::IImageResourceTarget container, or null if not available
◆ GetImageResourceTarget() [2/2]
|
pure virtual |
Get a constant Graph::IImageResourceTarget container.
This method returns a constant pointer to a Graph::IImageResourceTarget container, which allows to query the image resources referenced by a node implementing this interface.
- Returns
- The constant Graph::IImageResourceTarget container, or null if not available
◆ SetVideoStream() [1/2]
|
pure virtual |
Manually set a video stream for a given layer and target.
This method can be used to supply a manually created video stream as the texture's pixel source. Note, that you cannot supply both an image resource and a video stream for the same target. Note also, that the user is responsible for correct destruction of the given stream. The layer parameter must specify a layer in the range from 0 to GetNumberOfLayers()-1.
- Parameters
-
target The texture target (flat, or one of the 6 cube map sides) layer The texture layer stream The video stream to apply.
- Returns
- true if successful.
◆ SetVideoStream() [2/2]
|
pure virtual |
Manually set a video stream for layer 0 and a given target.
This method can be used to supply a manually created video stream as the texture's pixel source. Note, that you cannot supply both an image resource and a video stream for the same target. Note also, that the user is responsible for correct destruction of the given stream.
- Parameters
-
target The texture target (flat, or one of the 6 cube map sides) stream The video stream to apply.
- Returns
- true if successful.
◆ GetVideoStream() [1/2]
|
pure virtual |
Get the video stream for a given layer and target.
- Parameters
-
layer The texture layer target The texture target to query
- Returns
- The video stream at the given target, or null if none is active.
◆ GetVideoStream() [2/2]
|
pure virtual |
Get the video stream for layer 0 and a given target.
- Parameters
-
target The texture target to query
- Returns
- The video stream at the given target, or null if none is active.
◆ SetType()
|
pure virtual |
Set the texture type.
For a generic node implementing this interface, the actual texture type may be set using this method. For specialized implementations that implicitly set the type (like flat textures or cube maps), this method always returns false.
- Parameters
-
type One of the available texture types.
- Returns
- true if successful.
◆ GetType()
|
pure virtual |
Get the texture type.
- Returns
- The actual texture type.
◆ SetNumberOfLayers()
Set the number of texture layers.
If the node's type is not an array texture (flat or cubemap), this method returns false. See SetType().
- Parameters
-
numLayers The number of array layers.
- Returns
- true if successful.
◆ GetNumberOfLayers()
|
pure virtual |
Get the number of texture layers.
If the node's type is not an array texture (flat or cubemap), this method always returns 1. See SetType().
- Returns
- The number of array layers.
◆ SetMipMapGenerationMode()
|
pure virtual |
Set the MIP map generation mode.
By default, the MIP map generation mode is set to IEnums::MIP_MAP_GENERATION_MODE_FAST.
- Parameters
-
mode The MIP map generation mode.
- Returns
- true if successful.
◆ GetMipMapGenerationMode()
|
pure virtual |
Get the texture type.
- Returns
- The actual texture type.
◆ SetSize()
Set the texure's dimensions.
A given value has no effect if a positive non-zero scale factor is defined for the respective axis via SetAutoScaleFactor().
- Parameters
-
sizeX The texture width in pixels. sizeY The texture height in pixels.
- Returns
- true if successful.
◆ GetSizeX()
|
pure virtual |
Get the texture's base width.
This returns the base width of the texture (at MIP level 0), which is either defined via SetSize(), SetAutoScaleFactor() or implicitly from a given image resource when none of the previous value is defined. A possible prescale factor is not considered.
- Returns
- The texture width in pixels.
◆ GetSizeY()
|
pure virtual |
◆ SetAutoScaleFactor()
Set the texure's auto scale factors.
By default, the auto scale factors for both axes are set to 0.0, and the texture's dimensions match the values given via SetSize(). If any of the given scale factors is a positive non-zero value, the actual texture dimension for the respective axis is calculated from the current output surface dimension multiplied by that factor. In this case, a size value set via SetSize() has no effect. The current output surface size is retrieved via IAppConfiguration::GetDisplaySurfaceSizeX() and IAppConfiguration::GetDisplaySurfaceSizeY(). This is useful for e.g. post-processing frame buffer textures, which are supposed to match the current output display dimensions. For example, to create a texture that is half as wide and equal in height as the current output surface, specify a value of 0.5 for scaleX and a value of 1.0 for scaleY.
- Parameters
-
scaleX The width scale factor. scaleY The height scale factor.
- Returns
- true if successful.
◆ GetAutoScaleFactorX()
|
pure virtual |
Get the texture's width.
- Returns
- The texture width in pixels.
◆ GetAutoScaleFactorY()
|
pure virtual |
Get the texture's height.
- Returns
- The texture height in pixels.
◆ SetAlphaEnabled()
Enable/disable the alpha channel for this texture.
- Parameters
-
enabled If true, the alpha channel should be used.
- Returns
- true if successful.
◆ IsAlphaEnabled()
|
pure virtual |
Check if the alpha channel is enabled for this texture.
- Returns
- true if enabled.
◆ SetMipMappingEnabled()
Enable/disable mip-mapping for this texture.
- Parameters
-
enabled If true, mip-maps are enabled.
- Returns
- true if successful.
◆ IsMipMappingEnabled()
|
pure virtual |
Check if mip-mapping is enabled for this texture.
- Returns
- true if enabled.
◆ SetPrescalingEnabled()
Enable/disable prescaling for this texture.
In the IEngineConfiguration, an application may define a power-of-2 texture prescale factor that can be used to e.g. scale down texture resources depending on a device's actual screen resolution. However, in certain cases it may not be desired to prescale all textures (e.g. when using shadow maps); for such textures, prescaling can be disabled using this method.
- Parameters
-
enabled If true, prescaling is enabled.
- Returns
- true if successful.
◆ IsPrescalingEnabled()
|
pure virtual |
Check if prescaling is enabled for this texture.
- Returns
- true if enabled.
◆ SetPixelFormat()
|
pure virtual |
Set the texture's actual pixel format.
- Parameters
-
pixelFormat The pixel format to use.
- Returns
- true if successful.
◆ GetPixelFormat()
|
pure virtual |
Get the texture's actual pixel format.
- Returns
- The texture's pixel format.
◆ SetWrapModeX()
|
pure virtual |
Set the texture's wrap mode in X direction.
- Parameters
-
mode The wrap mode.
- Returns
- true if successful.
◆ GetWrapModeX()
|
pure virtual |
Get the texture's wrap mode in X direction.
- Returns
- The wrap mode.
◆ SetWrapModeY()
|
pure virtual |
Set the texture's wrap mode in Y direction.
- Parameters
-
mode The wrap mode.
- Returns
- true if successful.
◆ GetWrapModeY()
|
pure virtual |
Get the texture's wrap mode in Y direction.
- Returns
- The wrap mode.
◆ SetWrapModeZ()
|
pure virtual |
Set the texture's wrap mode in Z direction.
- Parameters
-
mode The wrap mode.
- Returns
- true if successful.
◆ GetWrapModeZ()
|
pure virtual |
Get the texture's wrap mode in Z direction.
- Returns
- The wrap mode.
◆ SetMagFilter()
|
pure virtual |
Set the texture filter used for magnification.
Valid magFilter values are restricted to TEXTURE_FILTER_NEAREST and TEXTURE_FILTER_LINEAR.
- Parameters
-
magFilter The filter to use.
- Returns
- true if successful.
◆ GetMagFilter()
|
pure virtual |
Get the texture filter used for magnification.
- Returns
- The filter used.
◆ SetMinFilter()
|
pure virtual |
Set the texture filter used for minification.
Valid minFilter values are restricted to TEXTURE_FILTER_NEAREST and TEXTURE_FILTER_LINEAR.
- Parameters
-
minFilter The filter to use.
- Returns
- true if successful.
◆ GetMinFilter()
|
pure virtual |
Get the texture filter used for minification.
- Returns
- The filter used.
◆ SetMipFilter()
|
pure virtual |
Set the texture filter used for mip-level selection.
- Parameters
-
mipFilter The filter to use.
- Returns
- true if successful.
◆ GetMipFilter()
|
pure virtual |
Get the texture filter used for mip-level selection.
- Returns
- The filter used.
◆ SetDepthTestMode()
|
pure virtual |
Set the depth compare mode, if the pixel format defines a depth texture.
- Parameters
-
mode The depth compare mode to use.
- Returns
- true if successful.
◆ GetDepthTestMode()
|
pure virtual |
Get the depth compare mode.
- Returns
- The depth compare mode used.
◆ SetDepthTestFunction()
|
pure virtual |
Set the depth test function, if the pixel format defines a depth texture and the depth compare mode is not NONE.
- Parameters
-
function The depth test function to use.
- Returns
- true if successful.
◆ GetDepthTestFunction()
|
pure virtual |
Get the depth test function.
- Returns
- The depth test function used.
◆ SetMaxAnisotropy()
Set the maximum anisotropy for filtering.
By default, a maximum anisotropy value of 0.0 is defined. In this case, the global value defined via Murl::IEngineConfiguration::SetDefaultMaxTextureAnisotropy() is used. If set to a value other than 0.0, the given value is used. The actual value is clamped to the range from 1.0 to the highest possible value defined in the graphics driver/hardware (typically around 16.0, but may be lower), with 1.0 representing isotropic filtering (fastest), and higher values producing better visual results at the cost of rendering performance. Note that if the maximum anisotropy is higher than 1.0, it may be the case that the actual filter(s) chosen by the graphics API are different than the ones specified via SetMagFilter(), SetMinFilter() and/or SetMipFilter().
- Parameters
-
maxAnisotropy The maximum anisotropy value.
- Returns
- true if successful.
◆ GetMaxAnisotropy()
|
pure virtual |
Set the maximum anisotropy for filtering.
- Returns
- The maximum anisotropy value.
◆ GetNumberOfDetailLevels()
|
pure virtual |
Get the texture's number of detail levels.
- Returns
- The number of detail levels.
◆ GetNumberOfStages()
Get the texture's number of stages for a given detail level.
- Parameters
-
detailLevel The detail level to query.
- Returns
- The number of stages.
◆ GetVideoTextureObject()
|
pure virtual |
Get the texture's internal video renderer object for a given pass.
- Parameters
-
detailLevel The detail level to query. stage The stage to query.
- Returns
- A pointer to the mutable video renderer object.
The documentation for this interface was generated from the following file:
- murl_graph_i_texture.h