#include <RenderState.h>
Public Member Functions | |
void | bind () |
void | setBlend (bool enabled) |
void | setBlendSrc (Blend blend) |
void | setBlendDst (Blend blend) |
void | setCullFace (bool enabled) |
void | setCullFaceSide (CullFaceSide side) |
void | setFrontFace (FrontFace winding) |
void | setDepthTest (bool enabled) |
void | setDepthWrite (bool enabled) |
void | setDepthFunction (DepthFunction func) |
void | setStencilTest (bool enabled) |
void | setStencilWrite (unsigned int mask) |
void | setStencilFunction (StencilFunction func, int ref, unsigned int mask) |
void | setStencilOperation (StencilOperation sfail, StencilOperation dpfail, StencilOperation dppass) |
void | setState (const char *name, const char *value) |
Static Public Member Functions | |
static StateBlock * | create () |
Defines a block of fixed-function render states that can be applied to a RenderState object.
Binds the state in this StateBlock to the renderer.
This method handles both setting and restoring of render states to ensure that only the state explicitly defined by this StateBlock is applied to the renderer.
static StateBlock* gameplay::RenderState::StateBlock::create | ( | ) | [static] |
Creates a new StateBlock with default render state settings.
void gameplay::RenderState::StateBlock::setBlend | ( | bool | enabled | ) |
Toggles blending.
enabled | true to enable, false to disable. |
void gameplay::RenderState::StateBlock::setBlendDst | ( | Blend | blend | ) |
Explicitly sets the source used in the blend function for this render state.
Note that the blend function is only applied when blending is enabled.
blend | Specifies how the destination blending factors are computed. |
void gameplay::RenderState::StateBlock::setBlendSrc | ( | Blend | blend | ) |
Explicitly sets the source used in the blend function for this render state.
Note that the blend function is only applied when blending is enabled.
blend | Specifies how the source blending factors are computed. |
void gameplay::RenderState::StateBlock::setCullFace | ( | bool | enabled | ) |
Explicitly enables or disables backface culling.
enabled | true to enable, false to disable. |
Sets the side of the facets to cull.
When not explicitly set, the default is to cull back-facing facets.
side | The side to cull. |
Sets the depth function to use when depth testing is enabled.
When not explicitly set and when depth testing is enabled, the default depth function is DEPTH_LESS.
func | The depth function. |
void gameplay::RenderState::StateBlock::setDepthTest | ( | bool | enabled | ) |
Toggles depth testing.
By default, depth testing is disabled.
enabled | true to enable, false to disable. |
void gameplay::RenderState::StateBlock::setDepthWrite | ( | bool | enabled | ) |
Toggles depth writing.
enabled | true to enable, false to disable. |
void gameplay::RenderState::StateBlock::setFrontFace | ( | FrontFace | winding | ) |
Sets the winding for front facing polygons.
By default, counter-clockwise wound polygons are considered front facing.
winding | The winding for front facing polygons. |
void gameplay::RenderState::StateBlock::setState | ( | const char * | name, |
const char * | value | ||
) |
Sets a render state from the given name and value strings.
This method attempts to interpret the passed in strings as render state name and value. This is normally used when loading render states from material files.
name | Name of the render state to set. |
value | Value of the specified render state. |
void gameplay::RenderState::StateBlock::setStencilFunction | ( | StencilFunction | func, |
int | ref, | ||
unsigned int | mask | ||
) |
Sets the stencil function.
By default, the function is set to STENCIL_ALWAYS, the reference value is 0, and the mask is all 1's.
func | The stencil function. |
ref | The stencil reference value. |
mask | The stencil mask. |
void gameplay::RenderState::StateBlock::setStencilOperation | ( | StencilOperation | sfail, |
StencilOperation | dpfail, | ||
StencilOperation | dppass | ||
) |
Sets the stencil operation.
By default, stencil fail, stencil pass/depth fail, and stencil and depth pass are set to STENCIL_OP_KEEP.
sfail | The stencil operation if the stencil test fails. |
dpfail | The stencil operation if the stencil test passes, but the depth test fails. |
dppass | The stencil operation if both the stencil test and depth test pass. |
void gameplay::RenderState::StateBlock::setStencilTest | ( | bool | enabled | ) |
Toggles stencil testing.
By default, stencil testing is disabled.
enabled | true to enable, false to disable. |
void gameplay::RenderState::StateBlock::setStencilWrite | ( | unsigned int | mask | ) |
Sets the stencil writing mask.
By default, the stencil writing mask is all 1's.
mask | Bit mask controlling writing to individual stencil planes. |