Castor3D  ..
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Castor3D::BlendState Class Referenceabstract

Blending configurations grouping class. More...

+ Inheritance diagram for Castor3D::BlendState:
+ Collaboration diagram for Castor3D::BlendState:

Classes

struct  stRT_BLEND_STATE
 

Public Member Functions

C3D_API BlendState (Engine &p_engine)
 Constructor. More...
 
virtual C3D_API ~BlendState ()
 Destructor. More...
 
virtual C3D_API bool Initialise ()=0
 Initialises the states. More...
 
virtual C3D_API void Cleanup ()=0
 Cleans the states. More...
 
virtual C3D_API bool Apply ()=0
 Applies the states. More...
 
bool IsAlphaToCoverageEnabled () const
 Retrieves the alpha to coverage activation status. More...
 
void EnableAlphaToCoverage (bool p_enable)
 Sets the alpha to coverage activation status. More...
 
bool IsIndependantBlendEnabled () const
 Retrieves the independant blending activation status. More...
 
void EnableIndependantBlend (bool p_enable)
 Sets the independant blending activation status. More...
 
const Castor::Colour & GetBlendFactors () const
 Retrieves the blend factors. More...
 
void SetBlendFactors (const Castor::Colour &p_clFactors)
 Sets the blend factors. More...
 
uint32_t GetSampleCoverageMask () const
 Retrieves the sample coverage mask. More...
 
void SetSampleCoverageMask (uint32_t p_uiMask)
 Sets the sample coverage mask. More...
 
bool IsBlendEnabled (uint8_t p_index=0) const
 Retrieves the blending activation status. More...
 
void EnableBlend (bool p_enable, uint8_t p_index=0)
 Sets the blending activation status. More...
 
eBLEND GetRgbSrcBlend (uint8_t p_index=0) const
 Retrieves the RGB source blending factor. More...
 
void SetRgbSrcBlend (eBLEND p_eValue, uint8_t p_index=0)
 Sets the RGB source blending factor. More...
 
eBLEND GetRgbDstBlend (uint8_t p_index=0) const
 Retrieves the RGB destination blending factor. More...
 
void SetRgbDstBlend (eBLEND p_eValue, uint8_t p_index=0)
 Sets the RGB destination blending factor. More...
 
eBLEND_OP GetRgbBlendOp (uint8_t p_index=0) const
 Retrieves the RGB blending operation. More...
 
void SetRgbBlendOp (eBLEND_OP p_eValue, uint8_t p_index=0)
 Sets the RGB blending operation. More...
 
eBLEND GetAlphaSrcBlend (uint8_t p_index=0) const
 Retrieves the alpha source blending factor. More...
 
void SetAlphaSrcBlend (eBLEND p_eValue, uint8_t p_index=0)
 Sets the alpha source blending factor. More...
 
eBLEND GetAlphaDstBlend (uint8_t p_index=0) const
 Retrieves the alpha destination blending factor. More...
 
void SetAlphaDstBlend (eBLEND p_eValue, uint8_t p_index=0)
 Sets the alpha destination blending factor. More...
 
eBLEND_OP GetAlphaBlendOp (uint8_t p_index=0) const
 Retrieves the RGB blending operation. More...
 
void SetAlphaBlendOp (eBLEND_OP p_value, uint8_t p_index=0)
 Sets the RGB blending operation. More...
 
uint8_t GetWriteMask (uint8_t p_index=0) const
 Retrieves the render target write mask. More...
 
void SetWriteMask (uint8_t p_value, uint8_t p_index=0)
 Sets the render target write mask. More...
 
void SetColourMask (eWRITING_MASK p_r, eWRITING_MASK p_g, eWRITING_MASK p_b, eWRITING_MASK p_a)
 Defines the colour writing mask. More...
 
eWRITING_MASK GetColourMaskR () const
 Retrieves the red colour component writing mask. More...
 
eWRITING_MASK GetColourMaskG () const
 Retrieves the green colour component writing mask. More...
 
eWRITING_MASK GetColourMaskB () const
 Retrieves the blue colour component writing mask. More...
 
eWRITING_MASK GetColourMaskA () const
 Retrieves the alpha colour component writing mask. More...
 

Protected Member Functions

C3D_API void CreateCurrent ()
 Creates the state used to save the current state. More...
 
C3D_API void DestroyCurrent ()
 Destroys the state used to save the current state. More...
 
virtual C3D_API BlendStateSPtr DoCreateCurrent ()=0
 Creates the state used to save the current state. More...
 

Protected Attributes

bool m_changed
 Tells if the blend state has changed. More...
 
bool m_bEnableAlphaToCoverage
 Tells if the alpha to coveage is enabled. More...
 
bool m_bIndependantBlend
 Tells ifthe independant blend states are activated. More...
 
Castor::Colour m_blendFactors
 Le blend colour. More...
 
uint32_t m_uiSampleMask
 The sample mask. More...
 
std::array< stRT_BLEND_STATE, 8 > m_rtStates
 the blend states More...
 
eWRITING_MASK m_eColourMask [4]
 Colours writing mask. More...
 
BlendStateSPtr m_currentState
 Shared_pointer to the internal global state, to use reference counting for this static member. More...
 

Static Protected Attributes

static BlendStateWPtr m_wCurrentState
 The internal global state used to commit only the changed states. More...
 

Detailed Description

Blending configurations grouping class.

Author
Sylvain DOREMUS
Version
0.7.0
Date
02/06/2013

Constructor & Destructor Documentation

◆ BlendState()

C3D_API Castor3D::BlendState::BlendState ( Engine p_engine)

Constructor.

Parameters
[in]p_engineThe engine.

◆ ~BlendState()

virtual C3D_API Castor3D::BlendState::~BlendState ( )
virtual

Destructor.

Member Function Documentation

◆ Apply()

virtual C3D_API bool Castor3D::BlendState::Apply ( )
pure virtual

Applies the states.

◆ Cleanup()

virtual C3D_API void Castor3D::BlendState::Cleanup ( )
pure virtual

Cleans the states.

◆ CreateCurrent()

C3D_API void Castor3D::BlendState::CreateCurrent ( )
protected

Creates the state used to save the current state.

◆ DestroyCurrent()

C3D_API void Castor3D::BlendState::DestroyCurrent ( )
protected

Destroys the state used to save the current state.

◆ DoCreateCurrent()

virtual C3D_API BlendStateSPtr Castor3D::BlendState::DoCreateCurrent ( )
protectedpure virtual

Creates the state used to save the current state.

◆ EnableAlphaToCoverage()

void Castor3D::BlendState::EnableAlphaToCoverage ( bool  p_enable)
inline

Sets the alpha to coverage activation status.

Parameters
[in]p_enableThe new value

References m_bEnableAlphaToCoverage, and m_changed.

◆ EnableBlend()

void Castor3D::BlendState::EnableBlend ( bool  p_enable,
uint8_t  p_index = 0 
)
inline

Sets the blending activation status.

Parameters
[in]p_enableThe new value
[in]p_indexThe value index

References m_changed, and m_rtStates.

◆ EnableIndependantBlend()

void Castor3D::BlendState::EnableIndependantBlend ( bool  p_enable)
inline

Sets the independant blending activation status.

Parameters
[in]p_enableThe new value

References m_bIndependantBlend, and m_changed.

◆ GetAlphaBlendOp()

eBLEND_OP Castor3D::BlendState::GetAlphaBlendOp ( uint8_t  p_index = 0) const
inline

Retrieves the RGB blending operation.

Parameters
[in]p_indexThe value index
Returns
The value

References m_rtStates.

◆ GetAlphaDstBlend()

eBLEND Castor3D::BlendState::GetAlphaDstBlend ( uint8_t  p_index = 0) const
inline

Retrieves the alpha destination blending factor.

Parameters
[in]p_indexThe value index
Returns
The value

References m_rtStates.

◆ GetAlphaSrcBlend()

eBLEND Castor3D::BlendState::GetAlphaSrcBlend ( uint8_t  p_index = 0) const
inline

Retrieves the alpha source blending factor.

Parameters
[in]p_indexThe value index
Returns
The value

References m_rtStates.

◆ GetBlendFactors()

const Castor::Colour& Castor3D::BlendState::GetBlendFactors ( ) const
inline

Retrieves the blend factors.

Returns
The value

References m_blendFactors.

◆ GetColourMaskA()

eWRITING_MASK Castor3D::BlendState::GetColourMaskA ( ) const
inline

Retrieves the alpha colour component writing mask.

Returns
The mask

References m_eColourMask.

◆ GetColourMaskB()

eWRITING_MASK Castor3D::BlendState::GetColourMaskB ( ) const
inline

Retrieves the blue colour component writing mask.

Returns
The mask

References m_eColourMask.

◆ GetColourMaskG()

eWRITING_MASK Castor3D::BlendState::GetColourMaskG ( ) const
inline

Retrieves the green colour component writing mask.

Returns
The mask

References m_eColourMask.

◆ GetColourMaskR()

eWRITING_MASK Castor3D::BlendState::GetColourMaskR ( ) const
inline

Retrieves the red colour component writing mask.

Returns
The mask

References m_eColourMask.

◆ GetRgbBlendOp()

eBLEND_OP Castor3D::BlendState::GetRgbBlendOp ( uint8_t  p_index = 0) const
inline

Retrieves the RGB blending operation.

Parameters
[in]p_indexThe value index
Returns
The value

References m_rtStates.

◆ GetRgbDstBlend()

eBLEND Castor3D::BlendState::GetRgbDstBlend ( uint8_t  p_index = 0) const
inline

Retrieves the RGB destination blending factor.

Parameters
[in]p_indexThe value index
Returns
The value

References m_rtStates.

◆ GetRgbSrcBlend()

eBLEND Castor3D::BlendState::GetRgbSrcBlend ( uint8_t  p_index = 0) const
inline

Retrieves the RGB source blending factor.

Parameters
[in]p_indexThe value index
Returns
The value

References m_rtStates.

◆ GetSampleCoverageMask()

uint32_t Castor3D::BlendState::GetSampleCoverageMask ( ) const
inline

Retrieves the sample coverage mask.

Returns
The value

References m_uiSampleMask.

◆ GetWriteMask()

uint8_t Castor3D::BlendState::GetWriteMask ( uint8_t  p_index = 0) const
inline

Retrieves the render target write mask.

Parameters
[in]p_indexThe value index
Returns
The value

References m_rtStates.

◆ Initialise()

virtual C3D_API bool Castor3D::BlendState::Initialise ( )
pure virtual

Initialises the states.

◆ IsAlphaToCoverageEnabled()

bool Castor3D::BlendState::IsAlphaToCoverageEnabled ( ) const
inline

Retrieves the alpha to coverage activation status.

Returns
The value

References m_bEnableAlphaToCoverage.

◆ IsBlendEnabled()

bool Castor3D::BlendState::IsBlendEnabled ( uint8_t  p_index = 0) const
inline

Retrieves the blending activation status.

Parameters
[in]p_indexThe value index
Returns
The value

References m_rtStates.

◆ IsIndependantBlendEnabled()

bool Castor3D::BlendState::IsIndependantBlendEnabled ( ) const
inline

Retrieves the independant blending activation status.

Returns
The value

References m_bIndependantBlend.

◆ SetAlphaBlendOp()

void Castor3D::BlendState::SetAlphaBlendOp ( eBLEND_OP  p_value,
uint8_t  p_index = 0 
)
inline

Sets the RGB blending operation.

Parameters
[in]p_valueThe new value
[in]p_indexThe value index

References m_changed, and m_rtStates.

◆ SetAlphaDstBlend()

void Castor3D::BlendState::SetAlphaDstBlend ( eBLEND  p_eValue,
uint8_t  p_index = 0 
)
inline

Sets the alpha destination blending factor.

Parameters
[in]p_eValueThe new value
[in]p_indexThe value index

References m_changed, and m_rtStates.

◆ SetAlphaSrcBlend()

void Castor3D::BlendState::SetAlphaSrcBlend ( eBLEND  p_eValue,
uint8_t  p_index = 0 
)
inline

Sets the alpha source blending factor.

Parameters
[in]p_eValueThe new value
[in]p_indexThe value index

References m_changed, and m_rtStates.

◆ SetBlendFactors()

void Castor3D::BlendState::SetBlendFactors ( const Castor::Colour &  p_clFactors)
inline

Sets the blend factors.

Parameters
[in]p_clFactorsThe new value

References m_blendFactors, and m_changed.

◆ SetColourMask()

void Castor3D::BlendState::SetColourMask ( eWRITING_MASK  p_r,
eWRITING_MASK  p_g,
eWRITING_MASK  p_b,
eWRITING_MASK  p_a 
)
inline

Defines the colour writing mask.

Parameters
[in]p_r,p_g,p_b,p_aThe mask for each colour component

References m_changed, and m_eColourMask.

◆ SetRgbBlendOp()

void Castor3D::BlendState::SetRgbBlendOp ( eBLEND_OP  p_eValue,
uint8_t  p_index = 0 
)
inline

Sets the RGB blending operation.

Parameters
[in]p_eValueThe new value
[in]p_indexThe value index

References m_changed, and m_rtStates.

◆ SetRgbDstBlend()

void Castor3D::BlendState::SetRgbDstBlend ( eBLEND  p_eValue,
uint8_t  p_index = 0 
)
inline

Sets the RGB destination blending factor.

Parameters
[in]p_eValueThe new value
[in]p_indexThe value index

References m_changed, and m_rtStates.

◆ SetRgbSrcBlend()

void Castor3D::BlendState::SetRgbSrcBlend ( eBLEND  p_eValue,
uint8_t  p_index = 0 
)
inline

Sets the RGB source blending factor.

Parameters
[in]p_eValueThe new value
[in]p_indexThe value index

References m_changed, and m_rtStates.

◆ SetSampleCoverageMask()

void Castor3D::BlendState::SetSampleCoverageMask ( uint32_t  p_uiMask)
inline

Sets the sample coverage mask.

Parameters
[in]p_uiMaskThe new value

References m_changed, and m_uiSampleMask.

◆ SetWriteMask()

void Castor3D::BlendState::SetWriteMask ( uint8_t  p_value,
uint8_t  p_index = 0 
)
inline

Sets the render target write mask.

Parameters
[in]p_valueThe new value
[in]p_indexThe value index

References m_changed, and m_rtStates.

Member Data Documentation

◆ m_bEnableAlphaToCoverage

bool Castor3D::BlendState::m_bEnableAlphaToCoverage
protected

Tells if the alpha to coveage is enabled.

Referenced by EnableAlphaToCoverage(), and IsAlphaToCoverageEnabled().

◆ m_bIndependantBlend

bool Castor3D::BlendState::m_bIndependantBlend
protected

Tells ifthe independant blend states are activated.

Referenced by EnableIndependantBlend(), and IsIndependantBlendEnabled().

◆ m_blendFactors

Castor::Colour Castor3D::BlendState::m_blendFactors
protected

Le blend colour.

Referenced by GetBlendFactors(), and SetBlendFactors().

◆ m_changed

bool Castor3D::BlendState::m_changed
protected

◆ m_currentState

BlendStateSPtr Castor3D::BlendState::m_currentState
protected

Shared_pointer to the internal global state, to use reference counting for this static member.

◆ m_eColourMask

eWRITING_MASK Castor3D::BlendState::m_eColourMask[4]
protected

◆ m_rtStates

std::array< stRT_BLEND_STATE, 8 > Castor3D::BlendState::m_rtStates
protected

◆ m_uiSampleMask

uint32_t Castor3D::BlendState::m_uiSampleMask
protected

The sample mask.

Referenced by GetSampleCoverageMask(), and SetSampleCoverageMask().

◆ m_wCurrentState

BlendStateWPtr Castor3D::BlendState::m_wCurrentState
staticprotected

The internal global state used to commit only the changed states.


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