Castor3D
..
|
Depth and stencil buffers configurations class. More...
Classes | |
struct | stSTENCIL |
Stencil function and operations description. More... | |
Public Member Functions | |
C3D_API | DepthStencilState (Engine &p_engine) |
Constructor. More... | |
virtual C3D_API | ~DepthStencilState () |
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... | |
void | SetDepthTest (bool p_enable) |
Defines the depth test status. More... | |
bool | GetDepthTest () const |
Retrieves the depth test status. More... | |
void | SetDepthFunc (eDEPTH_FUNC p_func) |
Defines the depth function. More... | |
eDEPTH_FUNC | GetDepthFunc () const |
Retrieves the depth function. More... | |
void | SetDepthRange (double p_near, double p_far) |
Defines the depth range. More... | |
double | GetDepthNear () const |
Retrieves the depth near value. More... | |
double | GetDepthFar () const |
Retrieves the depth far value. More... | |
void | SetDepthMask (eWRITING_MASK p_eMask) |
Defines the depth writing mask. More... | |
eWRITING_MASK | GetDepthMask () const |
Retrieves the depth writing mask. More... | |
void | SetStencilTest (bool p_enable) |
Defines the stencil test status. More... | |
bool | GetStencilTest () const |
Retrieves the stencil test status. More... | |
void | SetStencilReadMask (uint32_t p_uiMask) |
Defines the stencil read mask. More... | |
uint32_t | GetStencilReadMask () const |
Retrieves the stencil read mask. More... | |
void | SetStencilWriteMask (uint32_t p_uiMask) |
Defines the stencil write mask. More... | |
uint32_t | GetStencilWriteMask () const |
Retrieves the stencil write mask. More... | |
void | SetStencilFrontRef (uint32_t p_ref) |
Defines the stencil reference value for front faces. More... | |
uint32_t | GetStencilFrontRef () const |
Retrieves the stencil reference value for front faces. More... | |
void | SetStencilFrontFunc (eSTENCIL_FUNC p_func) |
Defines the stencil function for front faces. More... | |
eSTENCIL_FUNC | GetStencilFrontFunc () const |
Retrieves the stencil function for front faces. More... | |
void | SetStencilFrontFailOp (eSTENCIL_OP p_eOp) |
Defines the operation when stencil test failed, for front faces. More... | |
eSTENCIL_OP | GetStencilFrontFailOp () const |
Retrieves the operation when stencil test failed, for front faces. More... | |
void | SetStencilFrontDepthFailOp (eSTENCIL_OP p_eOp) |
Defines the operation when stencil test passes but depth test failed, for front faces. More... | |
eSTENCIL_OP | GetStencilFrontDepthFailOp () const |
Retrieves the operation when stencil test passes but depth test failed, for front faces. More... | |
void | SetStencilFrontPassOp (eSTENCIL_OP p_eOp) |
Defines the operation when stencil stencil and depth tests passed, for front faces. More... | |
eSTENCIL_OP | GetStencilFrontPassOp () const |
Retrieves the operation when stencil and depth tests passed, for front faces. More... | |
void | SetStencilBackRef (uint32_t p_ref) |
Defines the stencil reference value for back faces. More... | |
uint32_t | GetStencilBackRef () const |
Retrieves the stencil reference value for back faces. More... | |
void | SetStencilBackFunc (eSTENCIL_FUNC p_func) |
Defines the stencil function for front back. More... | |
eSTENCIL_FUNC | GetStencilBackFunc () const |
Retrieves the stencil function for back faces. More... | |
void | SetStencilBackFailOp (eSTENCIL_OP p_eOp) |
Defines the operation when stencil test failed, for back faces. More... | |
eSTENCIL_OP | GetStencilBackFailOp () const |
Retrieves the operation when stencil test failed, for back faces. More... | |
void | SetStencilBackDepthFailOp (eSTENCIL_OP p_eOp) |
Defines the operation when stencil test passes but depth test failed, for back faces. More... | |
eSTENCIL_OP | GetStencilBackDepthFailOp () const |
Retrieves the operation when stencil test passes but depth test failed, for back faces. More... | |
void | SetStencilBackPassOp (eSTENCIL_OP p_eOp) |
Defines the operation when stencil stencil and depth tests passed, for back faces. More... | |
eSTENCIL_OP | GetStencilBackPassOp () const |
Retrieves the operation when stencil and depth tests passed, for back faces. 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 DepthStencilStateSPtr | DoCreateCurrent ()=0 |
Creates the state used to save the current state. More... | |
Protected Attributes | |
bool | m_changed |
Tells it has changed. More... | |
bool | m_bDepthTest |
Tells whether the depth test is activated or not. More... | |
eDEPTH_FUNC | m_eDepthFunc |
The depth test function. More... | |
double | m_dDepthNear |
The near plane for depth test. More... | |
double | m_dDepthFar |
The far plane for depth test. More... | |
eWRITING_MASK | m_eDepthMask |
Depth writing mask. More... | |
bool | m_bStencilTest |
Tells whether the stencil test is activated or not. More... | |
uint32_t | m_uiStencilReadMask |
The stencil read mask. More... | |
uint32_t | m_uiStencilWriteMask |
The stencil write mask. More... | |
stSTENCIL | m_stStencilFront |
Front buffer stencil function. More... | |
stSTENCIL | m_stStencilBack |
Back buffer stencil function. More... | |
DepthStencilStateSPtr | m_currentState |
Shared_pointer to the internal global state, to use reference counting for this static member. More... | |
Static Protected Attributes | |
static DepthStencilStateWPtr | m_wCurrentState |
The internal global state used to commit only the changed states. More... | |
Depth and stencil buffers configurations class.
C3D_API Castor3D::DepthStencilState::DepthStencilState | ( | Engine & | p_engine | ) |
Constructor.
[in] | p_engine | The engine. |
|
virtual |
Destructor.
|
pure virtual |
Applies the states.
|
pure virtual |
Cleans the states.
|
protected |
Creates the state used to save the current state.
|
protected |
Destroys the state used to save the current state.
|
protectedpure virtual |
Creates the state used to save the current state.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Retrieves the operation when stencil test passes but depth test failed, for back faces.
References Castor3D::DepthStencilState::stSTENCIL::m_eDepthFailOp, and m_stStencilBack.
|
inline |
Retrieves the operation when stencil test failed, for back faces.
References Castor3D::DepthStencilState::stSTENCIL::m_eFailOp, and m_stStencilBack.
|
inline |
Retrieves the stencil function for back faces.
References Castor3D::DepthStencilState::stSTENCIL::m_eFunc, and m_stStencilBack.
|
inline |
Retrieves the operation when stencil and depth tests passed, for back faces.
References Castor3D::DepthStencilState::stSTENCIL::m_ePassOp, and m_stStencilBack.
|
inline |
Retrieves the stencil reference value for back faces.
References Castor3D::DepthStencilState::stSTENCIL::m_ref, and m_stStencilBack.
|
inline |
Retrieves the operation when stencil test passes but depth test failed, for front faces.
References Castor3D::DepthStencilState::stSTENCIL::m_eDepthFailOp, and m_stStencilFront.
|
inline |
Retrieves the operation when stencil test failed, for front faces.
References Castor3D::DepthStencilState::stSTENCIL::m_eFailOp, and m_stStencilFront.
|
inline |
Retrieves the stencil function for front faces.
References Castor3D::DepthStencilState::stSTENCIL::m_eFunc, and m_stStencilFront.
|
inline |
Retrieves the operation when stencil and depth tests passed, for front faces.
References Castor3D::DepthStencilState::stSTENCIL::m_ePassOp, and m_stStencilFront.
|
inline |
Retrieves the stencil reference value for front faces.
References Castor3D::DepthStencilState::stSTENCIL::m_ref, and m_stStencilFront.
|
inline |
|
inline |
|
inline |
|
pure virtual |
Initialises the states.
|
inline |
Defines the depth function.
[in] | p_func | The function |
References m_changed, and m_eDepthFunc.
|
inline |
Defines the depth writing mask.
[in] | p_eMask | The mask |
References m_changed, and m_eDepthMask.
|
inline |
Defines the depth range.
[in] | p_near | The near bound |
[in] | p_far | The far bound |
References m_changed, m_dDepthFar, and m_dDepthNear.
|
inline |
Defines the depth test status.
[in] | p_enable | The new status |
References m_bDepthTest, and m_changed.
|
inline |
Defines the operation when stencil test passes but depth test failed, for back faces.
[in] | p_eOp | The operation |
References m_changed, Castor3D::DepthStencilState::stSTENCIL::m_eDepthFailOp, and m_stStencilBack.
|
inline |
Defines the operation when stencil test failed, for back faces.
[in] | p_eOp | The operation |
References m_changed, Castor3D::DepthStencilState::stSTENCIL::m_eFailOp, and m_stStencilBack.
|
inline |
Defines the stencil function for front back.
[in] | p_func | The function |
References m_changed, Castor3D::DepthStencilState::stSTENCIL::m_eFunc, and m_stStencilBack.
|
inline |
Defines the operation when stencil stencil and depth tests passed, for back faces.
[in] | p_eOp | The operation |
References m_changed, Castor3D::DepthStencilState::stSTENCIL::m_ePassOp, and m_stStencilBack.
|
inline |
Defines the stencil reference value for back faces.
[in] | p_ref | The reference value |
References m_changed, Castor3D::DepthStencilState::stSTENCIL::m_ref, and m_stStencilBack.
|
inline |
Defines the operation when stencil test passes but depth test failed, for front faces.
[in] | p_eOp | The operation |
References m_changed, Castor3D::DepthStencilState::stSTENCIL::m_eDepthFailOp, and m_stStencilFront.
|
inline |
Defines the operation when stencil test failed, for front faces.
[in] | p_eOp | The operation |
References m_changed, Castor3D::DepthStencilState::stSTENCIL::m_eFailOp, and m_stStencilFront.
|
inline |
Defines the stencil function for front faces.
[in] | p_func | The function |
References m_changed, Castor3D::DepthStencilState::stSTENCIL::m_eFunc, and m_stStencilFront.
|
inline |
Defines the operation when stencil stencil and depth tests passed, for front faces.
[in] | p_eOp | The operation |
References m_changed, Castor3D::DepthStencilState::stSTENCIL::m_ePassOp, and m_stStencilFront.
|
inline |
Defines the stencil reference value for front faces.
[in] | p_ref | The reference value |
References m_changed, Castor3D::DepthStencilState::stSTENCIL::m_ref, and m_stStencilFront.
|
inline |
Defines the stencil read mask.
[in] | p_uiMask | The mask |
References m_changed, and m_uiStencilReadMask.
|
inline |
Defines the stencil test status.
[in] | p_enable | The new status |
References m_bStencilTest, and m_changed.
|
inline |
Defines the stencil write mask.
[in] | p_uiMask | The mask |
References m_changed, and m_uiStencilWriteMask.
|
protected |
Tells whether the depth test is activated or not.
Referenced by GetDepthTest(), and SetDepthTest().
|
protected |
Tells whether the stencil test is activated or not.
Referenced by GetStencilTest(), and SetStencilTest().
|
protected |
Tells it has changed.
Referenced by SetDepthFunc(), SetDepthMask(), SetDepthRange(), SetDepthTest(), SetStencilBackDepthFailOp(), SetStencilBackFailOp(), SetStencilBackFunc(), SetStencilBackPassOp(), SetStencilBackRef(), SetStencilFrontDepthFailOp(), SetStencilFrontFailOp(), SetStencilFrontFunc(), SetStencilFrontPassOp(), SetStencilFrontRef(), SetStencilReadMask(), SetStencilTest(), and SetStencilWriteMask().
|
protected |
Shared_pointer to the internal global state, to use reference counting for this static member.
|
protected |
The far plane for depth test.
Referenced by GetDepthFar(), and SetDepthRange().
|
protected |
The near plane for depth test.
Referenced by GetDepthNear(), and SetDepthRange().
|
protected |
The depth test function.
Referenced by GetDepthFunc(), and SetDepthFunc().
|
protected |
Depth writing mask.
Referenced by GetDepthMask(), and SetDepthMask().
|
protected |
Back buffer stencil function.
Referenced by GetStencilBackDepthFailOp(), GetStencilBackFailOp(), GetStencilBackFunc(), GetStencilBackPassOp(), GetStencilBackRef(), SetStencilBackDepthFailOp(), SetStencilBackFailOp(), SetStencilBackFunc(), SetStencilBackPassOp(), and SetStencilBackRef().
|
protected |
Front buffer stencil function.
Referenced by GetStencilFrontDepthFailOp(), GetStencilFrontFailOp(), GetStencilFrontFunc(), GetStencilFrontPassOp(), GetStencilFrontRef(), SetStencilFrontDepthFailOp(), SetStencilFrontFailOp(), SetStencilFrontFunc(), SetStencilFrontPassOp(), and SetStencilFrontRef().
|
protected |
The stencil read mask.
Referenced by GetStencilReadMask(), and SetStencilReadMask().
|
protected |
The stencil write mask.
Referenced by GetStencilWriteMask(), and SetStencilWriteMask().
|
staticprotected |
The internal global state used to commit only the changed states.