CUGL 4.0
Cornell University Game Library
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
cugl::graphics::StencilState Class Reference

#include <CUGraphicsBase.h>

Public Member Functions

 StencilState ()
 
 StencilState (StencilMode mode)
 
 StencilState (const StencilState &state)
 
StencilStateset (StencilMode mode)
 
StencilStateoperator= (StencilMode mode)
 
StencilStateoperator= (const StencilState &state)
 
bool operator== (const StencilState &state) const noexcept
 
bool operator!= (const StencilState &state) const noexcept
 
size_t hash ()
 

Public Attributes

StencilOp failOp
 
StencilOp passOp
 
StencilOp depthFailOp
 
CompareOp compareOp
 
Uint8 reference
 
Uint8 compareMask
 
Uint8 writeMask
 

Detailed Description

This class represents the state of the current stencil test

This class is used for fine-tuned control of the stencil buffer. For most application StencilMode should be adequate. Note that changing any of these values in Vulkans requires a pipeline swap.

Constructor & Destructor Documentation

◆ StencilState() [1/3]

cugl::graphics::StencilState::StencilState ( )

Creates default stencil test.

◆ StencilState() [2/3]

cugl::graphics::StencilState::StencilState ( StencilMode  mode)

Creates a stencil test for the given mode

Note that it is not sufficient to create a stencil test object from a mode. Modes often set other parameters in the graphics pipeline. Hence this constructor should never be used by the game developer.

Parameters
modeThe stencil test mode

◆ StencilState() [3/3]

cugl::graphics::StencilState::StencilState ( const StencilState state)

Creates a copy of the given stencil test

Parameters
stateThe stencil test to copy

Member Function Documentation

◆ hash()

size_t cugl::graphics::StencilState::hash ( )

Returns a hash code for this object.

This hash is used to manage pipeline swaps in Vulkan. It has no use in OpenGL.

Returns
a hash code for this object.

◆ operator!=()

bool cugl::graphics::StencilState::operator!= ( const StencilState state) const
noexcept

Returns true if the given stencil test is not equal to this object

Parameters
stateThe stencil test to compare
Returns
true if the given stencil test is not equal to this object

◆ operator=() [1/2]

StencilState & cugl::graphics::StencilState::operator= ( const StencilState state)

Assigns this object to be a copy of the given stencil test

Parameters
stateThe stencil test to copy
Returns
a reference to this object for chaining

◆ operator=() [2/2]

StencilState & cugl::graphics::StencilState::operator= ( StencilMode  mode)

Assigns this object to be equivalent to the given stencil mode.

Note that it is not sufficient to create a stencil test object from a mode. Modes often set other parameters in the graphics pipeline. Hence this assignment should never be used by the game developer.

Parameters
modeThe stencil test mode
Returns
a reference to this object for chaining

◆ operator==()

bool cugl::graphics::StencilState::operator== ( const StencilState state) const
noexcept

Returns true if the given stencil test is equal to this object

Parameters
stateThe stencil test to compare
Returns
true if the given stencil test is equal to this object

◆ set()

StencilState & cugl::graphics::StencilState::set ( StencilMode  mode)

Assigns this object to be equivalent to the given stencil mode.

Note that it is not sufficient to create a stencil test object from a mode. Modes often set other parameters in the graphics pipeline. Hence this assignment should never be used by the game developer.

Parameters
modeThe stencil test mode
Returns
a reference to this object for chaining

Member Data Documentation

◆ compareMask

Uint8 cugl::graphics::StencilState::compareMask

The mask to apply to the value before comparison

◆ compareOp

CompareOp cugl::graphics::StencilState::compareOp

The comparison operator fo the stencil test

◆ depthFailOp

StencilOp cugl::graphics::StencilState::depthFailOp

The action performed when the stencil test passes, but the depth test fails

◆ failOp

StencilOp cugl::graphics::StencilState::failOp

The action performed when the stencil test fails

◆ passOp

StencilOp cugl::graphics::StencilState::passOp

The action performed when the stencil test passes

◆ reference

Uint8 cugl::graphics::StencilState::reference

The reference value used by the comparison operation

◆ writeMask

Uint8 cugl::graphics::StencilState::writeMask

The mask to apply to the value written by the stencil operation


The documentation for this class was generated from the following file: