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

Holds all information about the blend operations to use when rendering. More...

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

Public Member Functions

virtual ~BlendState ()
 
virtual bool getAlphaToCoverageEnabled () const =0
 
virtual bool getIndependantBlendEnabled () const =0
 
virtual bool getTargetBlendEnabled (unsigned int targetId=0) const =0
 
virtual BLEND getTargetSrcBlend (unsigned int targetId=0) const =0
 
virtual BLEND getTargetDestBlend (unsigned int targetId=0) const =0
 
virtual BLEND_OP getTargetBlendOp (unsigned int targetId=0) const =0
 
virtual BLEND getTargetSrcBlendAlpha (unsigned int targetId=0) const =0
 
virtual BLEND getTargetDestBlendAlpha (unsigned int targetId=0) const =0
 
virtual BLEND_OP getTargetBlendOpAlpha (unsigned int targetId=0) const =0
 
virtual COLOR_WRITE_ENABLE getTargetWriteMask (unsigned int targetId=0) const =0
 
virtual void setAlphaToCoverageEnabled (bool value)=0
 
virtual void setIndependentBlendEnabled (bool value)=0
 
virtual void setTargetBlendEnable (bool value, unsigned int targetId=0)=0
 
virtual void setTargetSrcBlend (BLEND type, unsigned int targetId=0)=0
 
virtual void setTargetDestBlend (BLEND type, unsigned int targetId=0)=0
 
virtual void setTargetBlendOp (BLEND_OP type, unsigned int targetId=0)=0
 
virtual void setTargetSrcBlendAlpha (BLEND type, unsigned int targetId=0)=0
 
virtual void setTargetDestBlendAlpha (BLEND type, unsigned int targetId=0)=0
 
virtual void setTargetBlendOpAlpha (BLEND_OP type, unsigned int targetId=0)=0
 
virtual void setTargetWriteMask (COLOR_WRITE_ENABLE mask, unsigned int targetId=0)=0
 
virtual void resetToDefault ()=0
 
virtual void exportClassToTree (nkExport::Node *rootNode)
 
virtual void importClassFromTree (nkExport::Node *rootNode)
 
- 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< BlendStatecreate (System *system=nullptr)
 

Detailed Description

Holds all information about the blend operations to use when rendering.

See BlendStateManager::createOrRetrieve() or BlendState::create() for instantiation.

Constructor & Destructor Documentation

◆ ~BlendState()

virtual nkGraphics::BlendState::~BlendState ( )
virtual

Destructor.

Remarks
See BlendStateManager::erase() if managed by the manager.

Member Function Documentation

◆ getAlphaToCoverageEnabled()

virtual bool nkGraphics::BlendState::getAlphaToCoverageEnabled ( ) const
pure virtual
Returns
Whether the alpha to coverage in multi sampling scenario is enabled (true) or not (false).

◆ getIndependantBlendEnabled()

virtual bool nkGraphics::BlendState::getIndependantBlendEnabled ( ) const
pure virtual
Returns
Whether the independant blending of targets is enabled (true) or not (false).

◆ getTargetBlendEnabled()

virtual bool nkGraphics::BlendState::getTargetBlendEnabled ( unsigned int  targetId = 0) const
pure virtual
Parameters
targetIdThe id of the target to query. Between [0, 7].
Returns
Whether the blending for requested target is enabled (true) or not (false).

◆ getTargetSrcBlend()

virtual BLEND nkGraphics::BlendState::getTargetSrcBlend ( unsigned int  targetId = 0) const
pure virtual
Parameters
targetIdThe id of the target to query. Between [0, 7].
Returns
The source blending used for colours.

◆ getTargetDestBlend()

virtual BLEND nkGraphics::BlendState::getTargetDestBlend ( unsigned int  targetId = 0) const
pure virtual
Parameters
targetIdThe id of the target to query. Between [0, 7].
Returns
The destination blending used for colours.

◆ getTargetBlendOp()

virtual BLEND_OP nkGraphics::BlendState::getTargetBlendOp ( unsigned int  targetId = 0) const
pure virtual
Parameters
targetIdThe id of the target to query. Between [0, 7].
Returns
The blending operation used for colours.

◆ getTargetSrcBlendAlpha()

virtual BLEND nkGraphics::BlendState::getTargetSrcBlendAlpha ( unsigned int  targetId = 0) const
pure virtual
Parameters
targetIdThe id of the target to query. Between [0, 7].
Returns
The source blending used for alpha.

◆ getTargetDestBlendAlpha()

virtual BLEND nkGraphics::BlendState::getTargetDestBlendAlpha ( unsigned int  targetId = 0) const
pure virtual
Parameters
targetIdThe id of the target to query. Between [0, 7].
Returns
The destination blending used for alpha.

◆ getTargetBlendOpAlpha()

virtual BLEND_OP nkGraphics::BlendState::getTargetBlendOpAlpha ( unsigned int  targetId = 0) const
pure virtual
Parameters
targetIdThe id of the target to query. Between [0, 7].
Returns
The blending operations used for alpha.

◆ getTargetWriteMask()

virtual COLOR_WRITE_ENABLE nkGraphics::BlendState::getTargetWriteMask ( unsigned int  targetId = 0) const
pure virtual
Parameters
targetIdThe id of the target to query. Between [0, 7].
Returns
The write mask used.

◆ setAlphaToCoverageEnabled()

virtual void nkGraphics::BlendState::setAlphaToCoverageEnabled ( bool  value)
pure virtual

Sets whether the alpha to coverage should be used during multi sampling.

Parameters
valueIf this option should be enabled (true) or not (false).

◆ setIndependentBlendEnabled()

virtual void nkGraphics::BlendState::setIndependentBlendEnabled ( bool  value)
pure virtual

Sets whether the blending should be made independant between all targets. If not, the blending is done the same accross all targets, using the parameters for target 0.

Parameters
valueWhether the option should be enabled (true) or not (false).

◆ setTargetBlendEnable()

virtual void nkGraphics::BlendState::setTargetBlendEnable ( bool  value,
unsigned int  targetId = 0 
)
pure virtual

Sets whether the blending for a particular target is enabled.

Parameters
valueWhether the blending is enabled (true) or not (false).
targetIdThe id of the target to alter. Between [0, 7].

◆ setTargetSrcBlend()

virtual void nkGraphics::BlendState::setTargetSrcBlend ( BLEND  type,
unsigned int  targetId = 0 
)
pure virtual

Sets the type of blending used when blending the source colour.

Parameters
typeThe blending to use.
targetIdThe id of the target to alter. Between [0, 7].

◆ setTargetDestBlend()

virtual void nkGraphics::BlendState::setTargetDestBlend ( BLEND  type,
unsigned int  targetId = 0 
)
pure virtual

Sets the type of blending used when blending the target colour.

Parameters
typeThe blending to use.
targetIdThe id of the target to alter. Between [0, 7].

◆ setTargetBlendOp()

virtual void nkGraphics::BlendState::setTargetBlendOp ( BLEND_OP  type,
unsigned int  targetId = 0 
)
pure virtual

Sets the blending operation used when blending colours.

Parameters
typeThe blending operation to use.
targetIdThe id of the target to alter. Between [0, 7].

◆ setTargetSrcBlendAlpha()

virtual void nkGraphics::BlendState::setTargetSrcBlendAlpha ( BLEND  type,
unsigned int  targetId = 0 
)
pure virtual

Sets the type of blending used when blending the source alpha.

Parameters
typeThe blending to use.
targetIdThe id of the target to alter. Between [0, 7].

◆ setTargetDestBlendAlpha()

virtual void nkGraphics::BlendState::setTargetDestBlendAlpha ( BLEND  type,
unsigned int  targetId = 0 
)
pure virtual

Sets the type of blending used when blending the destination alpha.

Parameters
typeThe blending to use.
targetIdThe id of the target to alter. Between [0, 7].

◆ setTargetBlendOpAlpha()

virtual void nkGraphics::BlendState::setTargetBlendOpAlpha ( BLEND_OP  type,
unsigned int  targetId = 0 
)
pure virtual

Sets the blending operation to use when blending alphas.

Parameters
typeThe blending operation to use.
targetIdThe id of the target to alter. Between [0, 7].

◆ setTargetWriteMask()

virtual void nkGraphics::BlendState::setTargetWriteMask ( COLOR_WRITE_ENABLE  mask,
unsigned int  targetId = 0 
)
pure virtual

Sets the write mask to use when blending colours.

Parameters
maskThe mask to use.
targetIdThe id of the target to alter. Between [0, 7].

◆ resetToDefault()

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

Resets the state to its default values.

◆ exportClassToTree()

virtual void nkGraphics::BlendState::exportClassToTree ( nkExport::Node rootNode)
virtual

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::BlendState::importClassFromTree ( nkExport::Node rootNode)
virtual

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<BlendState> nkGraphics::BlendState::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: