Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

sglColorMask Class Reference

#include <sglStatelet.hpp>

Inheritance diagram for sglColorMask::

sglStatelet sglObject List of all members.

Public Methods

 sglColorMask (bool red=true, bool green=true, bool blue=true, bool alpha=true)
virtual ~sglColorMask ()
void setMask (bool red, bool green, bool blue, bool alpha)
void getMask (bool &red, bool &green, bool &blue, bool &alpha) const
void apply (sglCurrState *curr_state) const
virtual void printInfo (ostream &ostrm, const char *indent_string) const

Detailed Description

This statelet encapsulates OpenGL's glColorMask() function which controls which color components actually get written into the color buffer.

Example:

   sglColorMask *cmask = new sglColorMask;     // all enabled by default
   cmask->setMask(true, false, false, false);  // only enable red components

Definition at line 696 of file sglStatelet.hpp.


Constructor & Destructor Documentation

sglColorMask::sglColorMask ( bool red = true,
bool green = true,
bool blue = true,
bool alpha = true ) [inline]
 

Constructor (also the default constructor). All component masks are set to true (enabled) by default.

Parameters:
red   True to enable writing of red component.
green   True to enable writing of green component.
blue   True to enable writing of blue component.
alpha   True to enable wrting of alpha component.

Definition at line 706 of file sglStatelet.hpp.

sglColorMask::~sglColorMask ( ) [inline, virtual]
 

virtual destructor.

Definition at line 710 of file sglStatelet.hpp.


Member Function Documentation

void sglColorMask::setMask ( bool red,
bool green,
bool blue,
bool alpha )
 

Set all the color component masks.

Parameters:
red   True to enable writing of red component.
green   True to enable writing of green component.
blue   True to enable writing of blue component.
alpha   True to enable wrting of alpha component.

Referenced by sglColorMask().

void sglColorMask::getMask ( bool & red,
bool & green,
bool & blue,
bool & alpha ) const
 

Query all the color component masks.

Parameters:
red   On return, contains true if red enabled, otherwise false.
green   On return, contains true if green enabled, otherwise false.
blue   On return, contains true if blue enabled, otherwise false.
alpha   On return, contains true if alpha enabled, otherwise false.

void sglColorMask::apply ( sglCurrState * curr_state ) const [virtual]
 

Apply this state change to the current rendering state.

Parameters:
curr_state   Required for statelets that affect one another. For example the sglTransparency sets up depth mask and blending modes which interact with the sglBlending and sglDepthMask statelets, and the curr_state object is used to resolve these internal issues.

Reimplemented from sglStatelet.

virtual void sglColorMask::printInfo ( ostream & ostrm,
const char * indent_string ) const [virtual]
 

Output the state of this node to the specified ostream.

Parameters:
ostrm   the ostream to which the output is sent
indent_string   the string (usually spaces) that is output at the beginning of every line of output

Reimplemented from sglStatelet.


The documentation for this class was generated from the following file:
Generated at Mon Jul 1 18:00:07 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001