Panda3D
|
An abstract cross-platform class for setting stencil buffer render states. More...
#include "stencilRenderStates.h"
Public Types | |
enum | StencilComparisonFunction { SCF_never, SCF_less_than, SCF_equal, SCF_less_than_or_equal, SCF_greater_than, SCF_not_equal, SCF_greater_than_or_equal, SCF_always } |
typedef void(* | StencilFunction )(StencilRenderStates::StencilRenderState stencil_render_state, StencilRenderStates *stencil_render_states) |
enum | StencilOperation { SO_keep, SO_zero, SO_replace, SO_increment, SO_decrement, SO_invert, SO_increment_saturate, SO_decrement_saturate } |
enum | StencilRenderState { SRS_front_enable, SRS_back_enable, SRS_front_comparison_function, SRS_front_stencil_fail_operation, SRS_front_stencil_pass_z_fail_operation, SRS_front_stencil_pass_z_pass_operation, SRS_reference, SRS_read_mask, SRS_write_mask, SRS_back_comparison_function, SRS_back_stencil_fail_operation, SRS_back_stencil_pass_z_fail_operation, SRS_back_stencil_pass_z_pass_operation, SRS_clear, SRS_clear_value, SRS_total, SRS_first = 0 } |
Public Member Functions | |
StencilRenderStates (GraphicsStateGuardian *gsg) | |
Constructor. | |
StencilType | get_stencil_render_state (StencilRenderStates::StencilRenderState stencil_render_state) |
Gets the current render state for the specified stencil render state. | |
void | set_stencil_function (StencilRenderStates::StencilRenderState stencil_render_state, StencilFunction stencil_function) |
Registers an API specific callback for setting a specified stencil render state. | |
void | set_stencil_render_state (bool execute_function, StencilRenderStates::StencilRenderState stencil_render_state, StencilType value) |
Sets the current render state for the specified stencil render state. | |
Public Attributes | |
GraphicsStateGuardian * | _gsg |
An abstract cross-platform class for setting stencil buffer render states.
Each gsg needs to create its own low-level API specific functions on how to set each render state. The "set_stencil_render_state" function can be used in an immediate-mode fashion.
Definition at line 29 of file stencilRenderStates.h.
Constructor.
All data is set to the default.
Definition at line 23 of file stencilRenderStates.cxx.
References set_stencil_render_state().
StencilType StencilRenderStates::get_stencil_render_state | ( | StencilRenderStates::StencilRenderState | stencil_render_state | ) |
Gets the current render state for the specified stencil render state.
Definition at line 99 of file stencilRenderStates.cxx.
void StencilRenderStates::set_stencil_function | ( | StencilRenderStates::StencilRenderState | stencil_render_state, |
StencilFunction | stencil_function | ||
) |
Registers an API specific callback for setting a specified stencil render state.
Definition at line 109 of file stencilRenderStates.cxx.
void StencilRenderStates::set_stencil_render_state | ( | bool | execute_function, |
StencilRenderStates::StencilRenderState | stencil_render_state, | ||
StencilType | value | ||
) |
Sets the current render state for the specified stencil render state.
The execute_function parameter can be used to defer the actual setting of the render state at the API level. This is useful for the OpenGL API where certain render states are not independent/atomic (i.e. glStencilFunc and glStencilOp).
Definition at line 74 of file stencilRenderStates.cxx.
Referenced by StencilRenderStates().