All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Luminous::StencilMode Class Reference

This class defines the stencil buffer operation mode. More...

#include <Luminous/StencilMode.hpp>

Public Types

enum  Function {
  Never = GL_NEVER, Less = GL_LESS, LessEqual = GL_LEQUAL, Greater = GL_GREATER,
  GreaterEqual = GL_GEQUAL, Equal = GL_EQUAL, NotEqual = GL_NOTEQUAL, Always = GL_ALWAYS
}
 Enumeration for stencil test See http://www.opengl.org/sdk/docs/man/xhtml/glStencilFunc.xml for details. More...
 
enum  Operation {
  Keep = GL_KEEP, Zero = GL_ZERO, Replace = GL_REPLACE, Increment = GL_INCR,
  IncrementWrap = GL_INCR_WRAP, Decrement = GL_DECR, DecrementWrap = GL_DECR_WRAP, Invert = GL_INVERT
}
 Enumeration for stencil actions See http://www.opengl.org/sdk/docs/man/xhtml/glStencilOp.xml for details. More...
 

Public Member Functions

Operation backDepthFailOp () const
 Returns stencil operation when back facing primitive doesn't pass depth test. More...
 
Function backFunction () const
 Returns test function used for back facing primitives. More...
 
unsigned int backMaskValue () const
 Returns mask value used in stencil tests of back facing primitives. More...
 
Operation backPassOp () const
 Returns stencil operation when back facing primitive passes both stencil and depth test. More...
 
int backRefValue () const
 Returns reference value used in stencil tests of back facing primitives. More...
 
Operation backStencilFailOp () const
 Returns stencil operation when back facing primitive doesn't pass stencil test. More...
 
LUMINOUS_API bool equal (const StencilMode &o) const
 Equality comparison of stencil modes. More...
 
Operation frontDepthFailOp () const
 Returns stencil operation when front facing primitive doesn't pass depth test. More...
 
Function frontFunction () const
 Returns test function used for front facing primitives. More...
 
unsigned int frontMaskValue () const
 Returns mask value used in stencil tests of front facing primitives. More...
 
Operation frontPassOp () const
 Returns stencil operation when front facing primitive passes both stencil and depth test. More...
 
int frontRefValue () const
 Returns reference value used in stencil tests of front facing primitives. More...
 
Operation frontStencilFailOp () const
 Returns stencil operation when front facing primitive doesn't pass stencil test. More...
 
LUMINOUS_API void setFunction (Face face, Function function, int ref, unsigned int mask)
 Set test functionality for stencil operations. More...
 
LUMINOUS_API void setOperation (Face face, Operation stencilFail, Operation depthFail, Operation pass)
 Set stencil operations. More...
 
LUMINOUS_API StencilMode ()
 Construct new StencilMode object.
 

Static Public Member Functions

static StencilMode Default ()
 Returns the default StencilMode object. More...
 

Detailed Description

This class defines the stencil buffer operation mode.

Back and front faces of the primitives have both their separate and own stencil operations.

Member Enumeration Documentation

Enumeration for stencil test See http://www.opengl.org/sdk/docs/man/xhtml/glStencilFunc.xml for details.

Enumerator
Never 

Never pass the test.

Less 

Pass if the reference value is less than stencil value.

LessEqual 

Pass if the reference value is less than or equal to stencil value.

Greater 

Pass if the reference value is greater than stencil value.

GreaterEqual 

Pass if the reference value is greater than or equal to stencil value.

Equal 

Pass if the reference value is equal to stencil value.

NotEqual 

Pass if the refence value is inequal to stencil value.

Always 

Always pass.

Enumeration for stencil actions See http://www.opengl.org/sdk/docs/man/xhtml/glStencilOp.xml for details.

Enumerator
Keep 

Keep the current value.

Zero 

Set stencil value to 0.

Replace 

replace current value

Increment 

Increment current value.

IncrementWrap 

Increment current value. Wrap in case of overflow.

Decrement 

Decrement current value.

DecrementWrap 

Decrement current value. Wrap in case of underflow.

Invert 

Bitvise invert current value.

Member Function Documentation

Operation Luminous::StencilMode::backDepthFailOp ( ) const
inline

Returns stencil operation when back facing primitive doesn't pass depth test.

Returns
Operation on depth test fail
Function Luminous::StencilMode::backFunction ( ) const
inline

Returns test function used for back facing primitives.

Returns
Test function for backfaces
unsigned int Luminous::StencilMode::backMaskValue ( ) const
inline

Returns mask value used in stencil tests of back facing primitives.

Returns
mask Mask used in stencil tests of back faces
Operation Luminous::StencilMode::backPassOp ( ) const
inline

Returns stencil operation when back facing primitive passes both stencil and depth test.

Returns
Operation on stencil and depth test pass
int Luminous::StencilMode::backRefValue ( ) const
inline

Returns reference value used in stencil tests of back facing primitives.

Returns
Reference value used for back faces
Operation Luminous::StencilMode::backStencilFailOp ( ) const
inline

Returns stencil operation when back facing primitive doesn't pass stencil test.

Returns
Operation on stencil test fail
static StencilMode Luminous::StencilMode::Default ( )
inlinestatic

Returns the default StencilMode object.

Returns
Default stencil mode
LUMINOUS_API bool Luminous::StencilMode::equal ( const StencilMode o) const

Equality comparison of stencil modes.

Parameters
oOther StencilMode
Returns
True if the modes were equal
Operation Luminous::StencilMode::frontDepthFailOp ( ) const
inline

Returns stencil operation when front facing primitive doesn't pass depth test.

Returns
Operation on depth test fail
Function Luminous::StencilMode::frontFunction ( ) const
inline

Returns test function used for front facing primitives.

Returns
Test function for front faces
unsigned int Luminous::StencilMode::frontMaskValue ( ) const
inline

Returns mask value used in stencil tests of front facing primitives.

Returns
mask Mask used in stencil tests of front faces
Operation Luminous::StencilMode::frontPassOp ( ) const
inline

Returns stencil operation when front facing primitive passes both stencil and depth test.

Returns
Operation on stencil and depth test pass
int Luminous::StencilMode::frontRefValue ( ) const
inline

Returns reference value used in stencil tests of front facing primitives.

Returns
Reference value used for front faces
Operation Luminous::StencilMode::frontStencilFailOp ( ) const
inline

Returns stencil operation when front facing primitive doesn't pass stencil test.

Returns
Operation on stencil test fail
LUMINOUS_API void Luminous::StencilMode::setFunction ( Face  face,
Function  function,
int  ref,
unsigned int  mask 
)

Set test functionality for stencil operations.

Parameters
faceFacing of the primitives for this stencil test
functionTest function to use
refReference value to use in stencil tests
maskMask to use in stencil operations
LUMINOUS_API void Luminous::StencilMode::setOperation ( Face  face,
Operation  stencilFail,
Operation  depthFail,
Operation  pass 
)

Set stencil operations.

Parameters
faceFacing of the primitives for this stencil operation
stencilFailAction to take when stencil test fails
depthFailAction to take if stencil test passes and depth test fails
passAction to take when both stencil and depth test passes