overview wiki api reference download
 All Classes Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Static Public Member Functions
gameplay::RenderState::StateBlock Class Reference

#include <RenderState.h>

Inheritance diagram for gameplay::RenderState::StateBlock:
gameplay::Ref

List of all members.

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 StateBlockcreate ()

Detailed Description

Defines a block of fixed-function render states that can be applied to a RenderState object.


Member Function Documentation

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.

Creates a new StateBlock with default render state settings.

Toggles blending.

Parameters:
enabledtrue to enable, false to disable.

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.

Parameters:
blendSpecifies how the destination blending factors are computed.

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.

Parameters:
blendSpecifies how the source blending factors are computed.

Explicitly enables or disables backface culling.

Parameters:
enabledtrue 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.

Parameters:
sideThe 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.

Parameters:
funcThe depth function.

Toggles depth testing.

By default, depth testing is disabled.

Parameters:
enabledtrue to enable, false to disable.

Toggles depth writing.

Parameters:
enabledtrue to enable, false to disable.

Sets the winding for front facing polygons.

By default, counter-clockwise wound polygons are considered front facing.

Parameters:
windingThe 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.

Parameters:
nameName of the render state to set.
valueValue 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.

Parameters:
funcThe stencil function.
refThe stencil reference value.
maskThe stencil mask.

Sets the stencil operation.

By default, stencil fail, stencil pass/depth fail, and stencil and depth pass are set to STENCIL_OP_KEEP.

Parameters:
sfailThe stencil operation if the stencil test fails.
dpfailThe stencil operation if the stencil test passes, but the depth test fails.
dppassThe stencil operation if both the stencil test and depth test pass.

Toggles stencil testing.

By default, stencil testing is disabled.

Parameters:
enabledtrue to enable, false to disable.

Sets the stencil writing mask.

By default, the stencil writing mask is all 1's.

Parameters:
maskBit mask controlling writing to individual stencil planes.
 All Classes Functions Variables Typedefs Enumerations Enumerator