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

sglFrontFace Class Reference

#include <sglStatelet.hpp>

Inheritance diagram for sglFrontFace::

sglStatelet sglObject List of all members.

Public Types

enum  FrontFaceEnum {
  eCCW = GL_CCW,
  eCW = GL_CW

Public Methods

 sglFrontFace (FrontFaceEnum winding=eCCW)
virtual ~sglFrontFace ()
void setFrontFace (FrontFaceEnum winding)
FrontFaceEnum getFrontFace () const
void apply (sglCurrState *curr_state) const
virtual void printInfo (ostream &ostrm, const char *indent_string) const

Protected Attributes

FrontFaceEnum m_winding

Detailed Description

This statelet encapsulates OpenGL's glFrontFace() function which controls how front-facing polygons are determined. By default, the mode is eCCW which corresponds to a counter-clockwise orientation of the ordered vertices of a projected polygon in window coordinates. The other side of the polygon can be specified as the "front" face if the mode is switched to eCW (clockwise). The presence of this statelet affects the sglCullMode operation.


   sglFrontFace *cmask = new sglFrontFace;     // eCCW by default
   cmask->setFrontFace(sglFrontFace::eCW);     // switch front face

Definition at line 1088 of file sglStatelet.hpp.

Member Enumeration Documentation

enum sglFrontFace::FrontFaceEnum

The front face mode tokens.

Enumeration values:
eCCW   counterclockwise (the default).
eCW   clockwise.

Definition at line 1092 of file sglStatelet.hpp.

Constructor & Destructor Documentation

sglFrontFace::sglFrontFace ( FrontFaceEnum winding = eCCW ) [inline]

Constructor (also the default constructor).

winding   One of the two FrontFaceEnum tokens. Defaults to eCCW.

Definition at line 1105 of file sglStatelet.hpp.

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

virtual destructor.

Definition at line 1109 of file sglStatelet.hpp.

Member Function Documentation

void sglFrontFace::setFrontFace ( FrontFaceEnum winding ) [inline]

Set the polygon winding mode.

winding   One of the two FrontFaceEnum tokens.

Definition at line 1114 of file sglStatelet.hpp.

FrontFaceEnum sglFrontFace::getFrontFace ( ) const [inline]

Query the current winding mode.

One of the two FrontFaceEnum tokens.

Definition at line 1119 of file sglStatelet.hpp.

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

Apply this state change to the current rendering state.

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 sglFrontFace::printInfo ( ostream & ostrm,
const char * indent_string ) const [virtual]

Output the state of this node to the specified ostream.

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