Defines a block of fixed-function render states that can be applied to a RenderState object.
More...
#include <RenderState.h>
|
| StateBlock ()=default |
| Creates a new StateBlock with default render state settings.
|
|
void | bind (PipelineDescriptor *programState) |
| Binds the state in this StateBlock to the renderer.
|
|
void | setBlendFunc (const BlendFunc &blendFunc) |
| Explicitly sets the source and destination used in the blend function for this render state.
|
|
void | setBlend (bool enabled) |
| Toggles blending.
|
|
void | setBlendSrc (backend::BlendFactor blend) |
| Explicitly sets the source used in the blend function for this render state.
|
|
void | setBlendDst (backend::BlendFactor blend) |
| Explicitly sets the source used in the blend function for this render state.
|
|
void | setCullFace (bool enabled) |
| Explicitly enables or disables backface culling.
|
|
void | setCullFaceSide (CullFaceSide side) |
| Sets the side of the facets to cull.
|
|
void | setFrontFace (FrontFace winding) |
| Sets the winding for front facing polygons.
|
|
void | setDepthTest (bool enabled) |
| Toggles depth testing.
|
|
void | setDepthWrite (bool enabled) |
| Toggles depth writing.
|
|
void | setDepthFunction (DepthFunction func) |
| Sets the depth function to use when depth testing is enabled.
|
|
void | setState (std::string_view name, std::string_view value) |
| Sets a render state from the given name and value strings.
|
|
Defines a block of fixed-function render states that can be applied to a RenderState object.
◆ StateBlock()
Creates a new StateBlock with default render state settings.
The recommended way to create StateBlocks is by calling create
. Don't use new
or delete
on them.
◆ bind()
void bind |
( |
PipelineDescriptor * | programState | ) |
|
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.
◆ setBlendFunc()
void setBlendFunc |
( |
const BlendFunc & | blendFunc | ) |
|
Explicitly sets the source and destination used in the blend function for this render state.
Note that the blend function is only applied when blending is enabled.
- Parameters
-
blendFunc | Specifies how the blending factors are computed. |
◆ setBlend()
void setBlend |
( |
bool | enabled | ) |
|
Toggles blending.
- Parameters
-
enabled | true to enable, false to disable. |
◆ setBlendSrc()
void setBlendSrc |
( |
backend::BlendFactor | 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.
- Parameters
-
blend | Specifies how the source blending factors are computed. |
◆ setBlendDst()
void setBlendDst |
( |
backend::BlendFactor | 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.
- Parameters
-
blend | Specifies how the destination blending factors are computed. |
◆ setCullFace()
void setCullFace |
( |
bool | enabled | ) |
|
Explicitly enables or disables backface culling.
- Parameters
-
enabled | true to enable, false to disable. |
◆ setCullFaceSide()
void setCullFaceSide |
( |
CullFaceSide | side | ) |
|
Sets the side of the facets to cull.
When not explicitly set, the default is to cull back-facing facets.
- Parameters
-
◆ setFrontFace()
Sets the winding for front facing polygons.
By default, counter-clockwise wound polygons are considered front facing.
- Parameters
-
winding | The winding for front facing polygons. |
◆ setDepthTest()
void setDepthTest |
( |
bool | enabled | ) |
|
Toggles depth testing.
By default, depth testing is disabled.
- Parameters
-
enabled | true to enable, false to disable. |
◆ setDepthWrite()
void setDepthWrite |
( |
bool | enabled | ) |
|
Toggles depth writing.
- Parameters
-
enabled | true to enable, false to disable. |
◆ setDepthFunction()
void setDepthFunction |
( |
DepthFunction | func | ) |
|
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
-
◆ setState()
void setState |
( |
std::string_view | name, |
|
|
std::string_view | 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
-
name | Name of the render state to set. |
value | Value of the specified render state. |
The documentation for this class was generated from the following file: