glStencilOp Function
GL_APICALL void GL_APIENTRY glStencilOp(
GLenum fail,
GLenum zfail,
GLenum zpass
);
| Name | Description | |
|---|---|---|
| in | fail | Action when the stencil test fails |
| in | zfail | Action when the stencil test passes but the depth test fails |
| in | zpass | Action when the stencil and depth tests both pass |
Configures the actions to take on stencil buffer values.
When the stencil test fails, the action specified by fail is taken on that stencil buffer value. When the stencil test passes and the depth test fails, the action specified by zfail is taken on that stencil buffer value. When the stencil and depth tests both pass, the action specified by zpass is taken on that stencil buffer value.
Set func, zfail, and zpass using the following values.
| GL_KEEP | Keep the current stencil value. |
|---|---|
| GL_ZERO | Replace the stencil value with 0. |
| GL_REPLACE | Replace the stencil value with the value specified by ref in glStencilFunc. |
| GL_INCR | Increment the stencil value by one. |
| GL_DECR | Decrement the stencil value by one. |
| GL_INVERT | Invert the stencil value bitwise. |
| GL_INCR_WRAP | Increment the stencil value by one. |
| GL_DECR_WRAP | Decrement the stencil value by one. |
This function generates the following errors.
| GL_INVALID_ENUM | The fail, zfail, or zpass argument was set to an invalid value. |
|---|---|
| GL_INVALID_OPERATION | This function was called without any command-list objects bound. |
CONFIDENTIAL