version 3.3

VRS::StencilBufferGL Class Reference

Operations Related to the OpenGL Stencil Buffer. More...

#include <vrs/opengl/stencilbuffergl.h>

Inheritance diagram for VRS::StencilBufferGL:

VRS::MonoAttribute VRS::Attribute VRS::RenderObj VRS::SharedObj VRS::Visitable

List of all members.

Public Types

enum  Operations { Unused = 1 << 0, EnableStencil = 1 << 1, DisableStencil = 1 << 2 }

Public Member Functions

 VRS_SERIALIZABLE_CLASS_ENUM (Operations)
 StencilBufferGL (int ops=StencilBufferGL::EnableStencil, GLenum func=GL_ALWAYS, GLint reference=0, GLuint mask=1, GLenum fail=GL_KEEP, GLenum zfail=GL_KEEP, GLenum zpass=GL_KEEP)
void enableOperation (int flagToBeAdded)
void disableOperation (int flagToBeRemoved)
int getOperations () const
void setStencilMask (GLuint mask)
GLuint getStencilMask () const
 Set/get the stencil mask.
void setFunction (GLenum func)
GLenum getFunction () const
void setReference (GLint reference)
GLint getReference () const
 Set/get the reference value for the comparison function.
void setFailOperation (GLenum fail)
GLenum getFailOperation () const
void setZFailOperation (GLenum zfail)
GLenum getZFailOperation () const
void setPassOperation (GLenum pass)
GLenum getPassOperation () const
 VRS_TYPEINFO (StencilBufferGL, MonoAttribute)
 VRS_SERIALIZABLE (StencilBufferGL)


Detailed Description

Operations Related to the OpenGL Stencil Buffer.

Member Enumeration Documentation

Enumerator:
Unused 
EnableStencil 
DisableStencil 


Constructor & Destructor Documentation

VRS::StencilBufferGL::StencilBufferGL ( int  ops = StencilBufferGL::EnableStencil,
GLenum  func = GL_ALWAYS,
GLint  reference = 0,
GLuint  mask = 1,
GLenum  fail = GL_KEEP,
GLenum  zfail = GL_KEEP,
GLenum  zpass = GL_KEEP 
)

Attribute to switch the stencil buffer on or off, set the stencil mask, function and operation. Use the standard OpenGL function identifiers in `function'.

Functionality for clearing the stencil buffer is provided by the FrameBufferGL attribute.


Member Function Documentation

VRS::StencilBufferGL::VRS_SERIALIZABLE_CLASS_ENUM ( Operations   ) 

void VRS::StencilBufferGL::enableOperation ( int  flagToBeAdded  ) 

void VRS::StencilBufferGL::disableOperation ( int  flagToBeRemoved  ) 

int VRS::StencilBufferGL::getOperations (  )  const [inline]

Configures a StencilBufferGL attribute. The operations specified are performed when the attribute is pushed to an engine.

void VRS::StencilBufferGL::setStencilMask ( GLuint  mask  ) 

GLuint VRS::StencilBufferGL::getStencilMask (  )  const [inline]

Set/get the stencil mask.

void VRS::StencilBufferGL::setFunction ( GLenum  func  ) 

GLenum VRS::StencilBufferGL::getFunction (  )  const [inline]

This is the comparison function for the stencil test. Stenciling applies a test that compares `reference' with the value stored in the stencil buffer. Depending on the result of the test, the value in the stencil buffer is modified. The comparison applies only to those bits where the corresponding bits of `mask' are 1. Possible values for `func' are:

void VRS::StencilBufferGL::setReference ( GLint  reference  ) 

GLint VRS::StencilBufferGL::getReference (  )  const [inline]

Set/get the reference value for the comparison function.

void VRS::StencilBufferGL::setFailOperation ( GLenum  fail  ) 

GLenum VRS::StencilBufferGL::getFailOperation (  )  const [inline]

void VRS::StencilBufferGL::setZFailOperation ( GLenum  zfail  ) 

GLenum VRS::StencilBufferGL::getZFailOperation (  )  const [inline]

void VRS::StencilBufferGL::setPassOperation ( GLenum  pass  ) 

GLenum VRS::StencilBufferGL::getPassOperation (  )  const [inline]

These methods determine how the stencil buffer is modified, when a fragment passes or fails a stencil test. The test is defined by `func', `reference' and `mask'. The `fail' operation is applied if the fragment fails the stencil test, `zfail' is applied if the stencil test is passed and the depth test is failed. `pass' is applied if both, depth and stencil test, are passed. Possible values for all three operations are:

VRS::StencilBufferGL::VRS_TYPEINFO ( StencilBufferGL  ,
MonoAttribute   
)

VRS::StencilBufferGL::VRS_SERIALIZABLE ( StencilBufferGL   ) 


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

Generated on Wed May 23 06:00:22 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact