Defines a block of fixed-function render states that can be applied to a RenderState object.
More...
Inherits Ref.
|
|
unsigned int | _ID |
| | object id, ScriptSupport need public _ID
|
| |
|
local | _ID |
| | object id, ScriptSupport need public _ID
|
| |
|
int | _luaID |
| | Lua reference id.
|
| |
|
local | _luaID |
| | Lua reference id.
|
| |
|
void * | _scriptObject |
| | scriptObject, support for swift
|
| |
|
local | _scriptObject |
| | scriptObject, support for swift
|
| |
|
bool | _rooted |
| | When true, it means that the object was already rooted.
|
| |
|
local | _rooted |
| | When true, it means that the object was already rooted.
|
| |
Defines a block of fixed-function render states that can be applied to a RenderState object.
The recommended way to create StateBlocks is by calling create.
Don't use new or delete on them.
The recommended way to create StateBlocks is by calling create.
Don't use new or delete on them.
The recommended way to create StateBlocks is by calling create.
Don't use new or delete on them.
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.
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.
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.
| 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. |
| var setBlendFunc |
( |
var |
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. |
| local setBlendFunc |
( |
local |
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. |
| void setBlend |
( |
bool |
enabled | ) |
|
Toggles blending.
- Parameters
-
| enabled | true to enable, false to disable. |
| var setBlend |
( |
var |
enabled | ) |
|
Toggles blending.
- Parameters
-
| enabled | true to enable, false to disable. |
| local setBlend |
( |
local |
enabled | ) |
|
Toggles blending.
- Parameters
-
| enabled | true to enable, false to disable. |
| void 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.
- Parameters
-
| blend | Specifies how the source blending factors are computed. |
| var setBlendSrc |
( |
var |
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. |
| local setBlendSrc |
( |
local |
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. |
| void 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.
- Parameters
-
| blend | Specifies how the destination blending factors are computed. |
| var setBlendDst |
( |
var |
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. |
| local setBlendDst |
( |
local |
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. |
| void setCullFace |
( |
bool |
enabled | ) |
|
Explicitly enables or disables backface culling.
- Parameters
-
| enabled | true to enable, false to disable. |
| var setCullFace |
( |
var |
enabled | ) |
|
Explicitly enables or disables backface culling.
- Parameters
-
| enabled | true to enable, false to disable. |
| local setCullFace |
( |
local |
enabled | ) |
|
Explicitly enables or disables backface culling.
- Parameters
-
| 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.
- Parameters
-
| var setCullFaceSide |
( |
var |
side | ) |
|
Sets the side of the facets to cull.
When not explicitly set, the default is to cull back-facing facets.
- Parameters
-
| local setCullFaceSide |
( |
local |
side | ) |
|
Sets the side of the facets to cull.
When not explicitly set, the default is to cull back-facing facets.
- Parameters
-
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. |
| var setFrontFace |
( |
var |
winding | ) |
|
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. |
| local setFrontFace |
( |
local |
winding | ) |
|
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. |
| void setDepthTest |
( |
bool |
enabled | ) |
|
Toggles depth testing.
By default, depth testing is disabled.
- Parameters
-
| enabled | true to enable, false to disable. |
| var setDepthTest |
( |
var |
enabled | ) |
|
Toggles depth testing.
By default, depth testing is disabled.
- Parameters
-
| enabled | true to enable, false to disable. |
| local setDepthTest |
( |
local |
enabled | ) |
|
Toggles depth testing.
By default, depth testing is disabled.
- Parameters
-
| enabled | true to enable, false to disable. |
| void setDepthWrite |
( |
bool |
enabled | ) |
|
Toggles depth writing.
- Parameters
-
| enabled | true to enable, false to disable. |
| var setDepthWrite |
( |
var |
enabled | ) |
|
Toggles depth writing.
- Parameters
-
| enabled | true to enable, false to disable. |
| local setDepthWrite |
( |
local |
enabled | ) |
|
Toggles depth writing.
- Parameters
-
| enabled | true to enable, false to disable. |
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
-
| var setDepthFunction |
( |
var |
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
-
| local setDepthFunction |
( |
local |
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
-
| void setState |
( |
const std::string & |
name, |
|
|
const std::string & |
value |
|
) |
| |
Toggles stencil testing.
By default, stencil testing is disabled.
- Parameters
-
| enabled | true to enable, false to disable. Sets the stencil writing mask. |
By default, the stencil writing mask is all 1's.
- Parameters
-
| mask | Bit mask controlling writing to individual stencil planes. 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
-
| func | The stencil function. |
| ref | The stencil reference value. |
| mask | The 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
-
| 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. 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. |
| var setState |
( |
var |
name, |
|
|
var |
value |
|
) |
| |
Toggles stencil testing.
By default, stencil testing is disabled.
- Parameters
-
| enabled | true to enable, false to disable. Sets the stencil writing mask. |
By default, the stencil writing mask is all 1's.
- Parameters
-
| mask | Bit mask controlling writing to individual stencil planes. 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
-
| func | The stencil function. |
| ref | The stencil reference value. |
| mask | The 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
-
| 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. 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. |
| local setState |
( |
local |
name, |
|
|
local |
value |
|
) |
| |
Toggles stencil testing.
By default, stencil testing is disabled.
- Parameters
-
| enabled | true to enable, false to disable. Sets the stencil writing mask. |
By default, the stencil writing mask is all 1's.
- Parameters
-
| mask | Bit mask controlling writing to individual stencil planes. 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
-
| func | The stencil function. |
| ref | The stencil reference value. |
| mask | The 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
-
| 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. 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. |
| static void invalidate |
( |
long |
stateBits | ) |
|
|
static |
Invalidates the default StateBlock.
Only call it if you are calling GL calls directly. Invoke this function at the end of your custom draw call. This function restores the default render state its defaults values. Since this function might call GL calls, it must be called in a GL context is present.
- Parameters
-
| stateBits | Bitwise-OR of the states that needs to be invalidated |
| var invalidate |
( |
var |
stateBits | ) |
|
|
static |
Invalidates the default StateBlock.
Only call it if you are calling GL calls directly. Invoke this function at the end of your custom draw call. This function restores the default render state its defaults values. Since this function might call GL calls, it must be called in a GL context is present.
- Parameters
-
| stateBits | Bitwise-OR of the states that needs to be invalidated |
| local invalidate |
( |
local |
stateBits | ) |
|
|
static |
Invalidates the default StateBlock.
Only call it if you are calling GL calls directly. Invoke this function at the end of your custom draw call. This function restores the default render state its defaults values. Since this function might call GL calls, it must be called in a GL context is present.
- Parameters
-
| stateBits | Bitwise-OR of the states that needs to be invalidated |
| static void restore |
( |
long |
stateOverrideBits | ) |
|
|
static |
Restores the global Render State to the default state.
The difference between invalidate() and restore(), is that restore() will restore the global Render State based on its current state. Only the states that were changed will be restored.
Rule of thumb:
- call
restore() if you want to restore to the default state after using StateBlock.
- call
invalidate() if you want to restore to the default state after calling manual GL calls.
| var restore |
( |
var |
stateOverrideBits | ) |
|
|
static |
Restores the global Render State to the default state.
The difference between invalidate() and restore(), is that restore() will restore the global Render State based on its current state. Only the states that were changed will be restored.
Rule of thumb:
- call
restore() if you want to restore to the default state after using StateBlock.
- call
invalidate() if you want to restore to the default state after calling manual GL calls.
| local restore |
( |
local |
stateOverrideBits | ) |
|
|
static |
Restores the global Render State to the default state.
The difference between invalidate() and restore(), is that restore() will restore the global Render State based on its current state. Only the states that were changed will be restored.
Rule of thumb:
- call
restore() if you want to restore to the default state after using StateBlock.
- call
invalidate() if you want to restore to the default state after calling manual GL calls.
The documentation for this class was generated from the following file: