API Documentation
Public Member Functions | Static Public Member Functions | List of all members
nkGraphics::Sampler Class Referenceabstract

Holds all the information needed of a sampler used during rendering. More...

Inheritance diagram for nkGraphics::Sampler:
nkGraphics::Resource nkExport::Exportable

Public Member Functions

virtual FILTER getFiltering () const =0
 
virtual TEXTURE_ADDRESS_MODE getAddressModeU () const =0
 
virtual TEXTURE_ADDRESS_MODE getAddressModeV () const =0
 
virtual TEXTURE_ADDRESS_MODE getAddressModeW () const =0
 
virtual COMPARISON_FUNC getComparisonFunc () const =0
 
virtual float getMipBias () const =0
 
virtual unsigned int getMaxAnisotropy () const =0
 
virtual float getMinLodLevel () const =0
 
virtual float getMaxLodLevel () const =0
 
virtual float getBorderColorR () const =0
 
virtual float getBorderColorG () const =0
 
virtual float getBorderColorB () const =0
 
virtual float getBorderColorA () const =0
 
nkMemory::StringView getFilteringAsString () const
 
nkMemory::StringView getAddressModeUAsString () const
 
nkMemory::StringView getAddressModeVAsString () const
 
nkMemory::StringView getAddressModeWAsString () const
 
nkMemory::StringView getComparisonFuncAsString () const
 
virtual void setBorderColors (float r, float g, float b, float a)=0
 
virtual void setBorderColorR (float value)=0
 
virtual void setBorderColorG (float value)=0
 
virtual void setBorderColorB (float value)=0
 
virtual void setBorderColorA (float value)=0
 
virtual void setLodLevels (float min, float max)=0
 
virtual void setMaxAnisotropy (unsigned int value)=0
 
virtual void setMipMapBias (float value)=0
 
virtual void setFilterMethod (FILTER value)=0
 
virtual void setAddressModeU (TEXTURE_ADDRESS_MODE value)=0
 
virtual void setAddressModeV (TEXTURE_ADDRESS_MODE value)=0
 
virtual void setAddressModeW (TEXTURE_ADDRESS_MODE value)=0
 
virtual void setComparisonFunc (COMPARISON_FUNC value)=0
 
virtual void resetToDefault ()=0
 
void setFilterMethodFromString (nkMemory::StringView value)
 
void setAddressModeUFromString (nkMemory::StringView value)
 
void setAddressModeVFromString (nkMemory::StringView value)
 
void setAddressModeWFromString (nkMemory::StringView value)
 
void setComparisonFuncFromString (nkMemory::StringView value)
 
virtual void exportClassToTree (nkExport::Node *rootNode) override
 
virtual void importClassFromTree (nkExport::Node *rootNode) override
 
- Public Member Functions inherited from nkGraphics::Resource
virtual ~Resource ()
 
bool isReadyForRendering () const
 
bool isUnloaded () const
 
RESOURCE_LOAD_STATE getLoadState () const
 
nkMemory::StringView getPath () const
 
RESOURCE_TYPE getTypeName () const
 
nkMemory::StringView getName () const
 
System * getSystem () const
 
bool getHidden () const
 
bool getGpuUploadCanBeDeferred () const
 
virtual void setPath (nkMemory::StringView value)
 
void setName (nkMemory::StringView value)
 
void setHidden (bool value)
 
void setGpuUploadCanBeDeferred (bool value)
 
virtual bool load ()=0
 
virtual void unload ()=0
 
- Public Member Functions inherited from nkExport::Exportable
 Exportable () noexcept
 
virtual ~Exportable ()
 

Static Public Member Functions

static nkMemory::UniquePtr< Samplercreate (System *system=nullptr)
 

Detailed Description

Holds all the information needed of a sampler used during rendering.

See SamplerManager::createOrRetrieve() or Sampler::create() for instantiation.

Member Function Documentation

◆ getFiltering()

virtual FILTER nkGraphics::Sampler::getFiltering ( ) const
pure virtual
Returns
The filtering used.

◆ getAddressModeU()

virtual TEXTURE_ADDRESS_MODE nkGraphics::Sampler::getAddressModeU ( ) const
pure virtual
Returns
The used address mode on the U axis.

◆ getAddressModeV()

virtual TEXTURE_ADDRESS_MODE nkGraphics::Sampler::getAddressModeV ( ) const
pure virtual
Returns
The used address mode in the V axis.

◆ getAddressModeW()

virtual TEXTURE_ADDRESS_MODE nkGraphics::Sampler::getAddressModeW ( ) const
pure virtual
Returns
The used address mode on the W axis.

◆ getComparisonFunc()

virtual COMPARISON_FUNC nkGraphics::Sampler::getComparisonFunc ( ) const
pure virtual
Returns
The comparison function used.

◆ getMipBias()

virtual float nkGraphics::Sampler::getMipBias ( ) const
pure virtual
Returns
The mip bias used.

◆ getMaxAnisotropy()

virtual unsigned int nkGraphics::Sampler::getMaxAnisotropy ( ) const
pure virtual
Returns
The max anisotropy used.

◆ getMinLodLevel()

virtual float nkGraphics::Sampler::getMinLodLevel ( ) const
pure virtual
Returns
The min LOD level used.

◆ getMaxLodLevel()

virtual float nkGraphics::Sampler::getMaxLodLevel ( ) const
pure virtual
Returns
The max LOD level used.

◆ getBorderColorR()

virtual float nkGraphics::Sampler::getBorderColorR ( ) const
pure virtual
Returns
The used border color red component.

◆ getBorderColorG()

virtual float nkGraphics::Sampler::getBorderColorG ( ) const
pure virtual
Returns
The used border color green component.

◆ getBorderColorB()

virtual float nkGraphics::Sampler::getBorderColorB ( ) const
pure virtual
Returns
The used border color blue component.

◆ getBorderColorA()

virtual float nkGraphics::Sampler::getBorderColorA ( ) const
pure virtual
Returns
The used border color alpha component.

◆ getFilteringAsString()

nkMemory::StringView nkGraphics::Sampler::getFilteringAsString ( ) const
Returns
The filtering, translated as a string using the StructToString utility.

◆ getAddressModeUAsString()

nkMemory::StringView nkGraphics::Sampler::getAddressModeUAsString ( ) const
Returns
The address mode Y, translated as a string using the StructToString utility.

◆ getAddressModeVAsString()

nkMemory::StringView nkGraphics::Sampler::getAddressModeVAsString ( ) const
Returns
The address mode V, translated as a string using the StructToString utility.

◆ getAddressModeWAsString()

nkMemory::StringView nkGraphics::Sampler::getAddressModeWAsString ( ) const
Returns
The address mode W, translated as a string using the StructToString utility.

◆ getComparisonFuncAsString()

nkMemory::StringView nkGraphics::Sampler::getComparisonFuncAsString ( ) const
Returns
The comparison function, translated as a string using the StructToString utility.

◆ setBorderColors()

virtual void nkGraphics::Sampler::setBorderColors ( float  r,
float  g,
float  b,
float  a 
)
pure virtual

Sets the border color to use. Border color is used, depending on the addressing mode, when the uvw coordinates go out of [0.0, 1.0].

Parameters
rThe red component to use, between [0.0, 1.0].
gThe green component to use, between [0.0, 1.0].
bThe blue component to use, between [0.0, 1.0].
aThe alpha component to use, between [0.0, 1.0].

◆ setBorderColorR()

virtual void nkGraphics::Sampler::setBorderColorR ( float  value)
pure virtual

Individual setter for the border color.

Parameters
valueThe red component value to use, between [0.0, 1.0].

◆ setBorderColorG()

virtual void nkGraphics::Sampler::setBorderColorG ( float  value)
pure virtual

Individual setter for the border color.

Parameters
valueThe green component value to use, between [0.0, 1.0].

◆ setBorderColorB()

virtual void nkGraphics::Sampler::setBorderColorB ( float  value)
pure virtual

Individual setter for the border color.

Parameters
valueThe blue component value to use, between [0.0, 1.0].

◆ setBorderColorA()

virtual void nkGraphics::Sampler::setBorderColorA ( float  value)
pure virtual

Individual setter for the border color.

Parameters
valueThe alpha component value to use, between [0.0, 1.0].

◆ setLodLevels()

virtual void nkGraphics::Sampler::setLodLevels ( float  min,
float  max 
)
pure virtual

Sets the LOD levels to use.

Parameters
minThe minimal LOD level to use.
maxThe maximal LOD level to use.

◆ setMaxAnisotropy()

virtual void nkGraphics::Sampler::setMaxAnisotropy ( unsigned int  value)
pure virtual

Sets the maximal anisotropy level to use.

Parameters
valueThe maximal anisotropy level to use.

◆ setMipMapBias()

virtual void nkGraphics::Sampler::setMipMapBias ( float  value)
pure virtual

Sets the mip bias.

Parameters
valueThe bias to use.

◆ setFilterMethod()

virtual void nkGraphics::Sampler::setFilterMethod ( FILTER  value)
pure virtual

Sets the filter method.

Parameters
valueThe filtering method to use.

◆ setAddressModeU()

virtual void nkGraphics::Sampler::setAddressModeU ( TEXTURE_ADDRESS_MODE  value)
pure virtual

Sets the address mode.

Parameters
valueThe addres mode to use over the u axis.

◆ setAddressModeV()

virtual void nkGraphics::Sampler::setAddressModeV ( TEXTURE_ADDRESS_MODE  value)
pure virtual

Sets the address mode.

Parameters
valueThe addres mode to use over the v axis.

◆ setAddressModeW()

virtual void nkGraphics::Sampler::setAddressModeW ( TEXTURE_ADDRESS_MODE  value)
pure virtual

Sets the address mode.

Parameters
valueThe addres mode to use over the w axis.

◆ setComparisonFunc()

virtual void nkGraphics::Sampler::setComparisonFunc ( COMPARISON_FUNC  value)
pure virtual

Sets the comparison function.

Parameters
valueThe comparison function to use.

◆ resetToDefault()

virtual void nkGraphics::Sampler::resetToDefault ( )
pure virtual

Resets the sampler to its default configuration.

◆ setFilterMethodFromString()

void nkGraphics::Sampler::setFilterMethodFromString ( nkMemory::StringView  value)

Sets the filtering method, from a string.

Parameters
valueThe filtering method to use. Will be translated through StructToString.

◆ setAddressModeUFromString()

void nkGraphics::Sampler::setAddressModeUFromString ( nkMemory::StringView  value)

Sets the address mode on axis u from a string.

Parameters
valueThe address mode to use. Will be translated through StructToString.

◆ setAddressModeVFromString()

void nkGraphics::Sampler::setAddressModeVFromString ( nkMemory::StringView  value)

Sets the address mode on axis v from a string.

Parameters
valueThe address mode to use. Will be translated through StructToString.

◆ setAddressModeWFromString()

void nkGraphics::Sampler::setAddressModeWFromString ( nkMemory::StringView  value)

Sets the address mode on axis w from a string.

Parameters
valueThe address mode to use. Will be translated through StructToString.

◆ setComparisonFuncFromString()

void nkGraphics::Sampler::setComparisonFuncFromString ( nkMemory::StringView  value)

Sets the comparison function from a string.

Parameters
valueThe comparison function to use. Will be translated through StructToString.

◆ exportClassToTree()

virtual void nkGraphics::Sampler::exportClassToTree ( nkExport::Node rootNode)
overridevirtual

Exports an item into a tree describing its structure and its data.

Parameters
rootNodeThe node into which the object has to write its related information.

Implements nkExport::Exportable.

◆ importClassFromTree()

virtual void nkGraphics::Sampler::importClassFromTree ( nkExport::Node rootNode)
overridevirtual

Imports information from a tree which is supposed to describe its structure and data.

Parameters
rootNodeThe root node of the tree holding the information.

Implements nkExport::Exportable.

◆ create()

static nkMemory::UniquePtr<Sampler> nkGraphics::Sampler::create ( System *  system = nullptr)
static

Creates a standalone resource, linking it to a system, but no manager. This method can be used to allocate a resource and manually manage its lifetime.

Parameters
systemThe system to create the resource into. If left to nullptr, then the Singleton instance will be used.
Returns
The created resource instance.

The documentation for this class was generated from the following file: