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

sglDepthTest Class Reference

#include <sglStatelet.hpp>

Inheritance diagram for sglDepthTest::

sglStatelet sglObject List of all members.

Public Types

enum  DepthFuncEnum {

Public Methods

 sglDepthTest (DepthFuncEnum func=eLESS)
virtual ~sglDepthTest ()
void setDepthFunc (DepthFuncEnum func)
DepthFuncEnum getDepthFunc () const
void apply (sglCurrState *curr_state) const
virtual void printInfo (ostream &ostrm, const char *indent_string) const

Detailed Description

This statelet encapsulates the OpenGL's glDepthFunc() and glEnable(GL_DEPTH_TEST) functions which controls how new rendering fragments are tested against the depth buffer to determine if they are visible. The user only needs to specify the depth function which is the test used to compare incoming fragments with existing depth buffer values. If the user passes in sglDepthTest::eALWAYS, this is equivalent to disabling depth test.


   sglDepthTest *dtest = new sglDepthTest(sglDepthTest::eALWAYS); // disable

Definition at line 968 of file sglStatelet.hpp.

Member Enumeration Documentation

enum sglDepthTest::DepthFuncEnum

The various depth functions.

Enumeration values:
eLESS   The default test: pass if fragment depths are less (closer).
eALWAYS   Disables the depth test (everything passes).
eNEVER   Whats the point of this?

Definition at line 972 of file sglStatelet.hpp.

Constructor & Destructor Documentation

sglDepthTest::sglDepthTest ( DepthFuncEnum func = eLESS ) [inline]

Constructor (also the default constructor).

func   One of the DepthFuncEnum tokens. The default is eLESS.

Definition at line 996 of file sglStatelet.hpp.

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

virtual destructor.

Definition at line 1003 of file sglStatelet.hpp.

Member Function Documentation

void sglDepthTest::setDepthFunc ( DepthFuncEnum func )

Set a depth function.

func   One of the DepthFuncEnum tokens.

DepthFuncEnum sglDepthTest::getDepthFunc ( ) const [inline]

Query the current depth function.

One of the DepthFuncEnum tokens.

Definition at line 1013 of file sglStatelet.hpp.

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