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

sglCullMode Class Reference

#include <sglStatelet.hpp>

Inheritance diagram for sglCullMode::

sglStatelet sglObject List of all members.

Public Types

enum  CullModeEnum {
  eBACK = 0,

Public Methods

 sglCullMode (CullModeEnum mode=eBACK)
virtual ~sglCullMode ()
void setCullMode (CullModeEnum mode)
CullModeEnum getCullMode () const
void apply (sglCurrState *curr_state) const
virtual void printInfo (ostream &ostrm, const char *indent_string) const

Detailed Description

This statelet encapsulates OpenGL's glCullFace() and glEnable(GL_CULL_FACE) functionality to determine which sides of polygons are culled (discarded) before they are processed by the rendering pipeline. The back faces (as determined by polygon winding and the sglFrontFace statelet) are culled by default, but the user can also cull the front faces, both sides, or neither side by specifying one of the sglCullMode::CullModeEnum values.

See also: sglFrontFace


   sglCullMode *cullMode = new sglCullMode;       // defaults to eBACK

Definition at line 766 of file sglStatelet.hpp.

Member Enumeration Documentation

enum sglCullMode::CullModeEnum

The cull mode enums.

Enumeration values:
eBACK   cull back faces.
eOFF   don't cull any faces.
eFRONT   cull the front faces.
eFRONT_AND_BACK   cull both faces.

Definition at line 770 of file sglStatelet.hpp.

Constructor & Destructor Documentation

sglCullMode::sglCullMode ( CullModeEnum mode = eBACK ) [inline]

Constructor (also the default constructor).

mode   One of the CullModeEnum values to specify which face(s) to cull (defaults to sglCullMode::eBACK.

Definition at line 787 of file sglStatelet.hpp.

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

virtual destructor.

Definition at line 791 of file sglStatelet.hpp.

Member Function Documentation

void sglCullMode::setCullMode ( CullModeEnum mode ) [inline]

Set the cull mode.

mode   One of the CullModeEnum values to specify which face(s) to cull.

Definition at line 797 of file sglStatelet.hpp.

CullModeEnum sglCullMode::getCullMode ( ) const [inline]

Query the current cull mode.

One of the CullModeEnum's corresponding to the current cull mode.

Definition at line 803 of file sglStatelet.hpp.

void sglCullMode::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 sglCullMode::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