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

sglAlphaTest Class Reference

#include <sglStatelet.hpp>

Inheritance diagram for sglAlphaTest::

sglStatelet sglObject List of all members.

Public Types

enum  AlphaFuncEnum {

Public Methods

 sglAlphaTest (AlphaFuncEnum func=eALWAYS, float ref=0.0f)
virtual ~sglAlphaTest ()
void setAlphaFunc (AlphaFuncEnum func, float ref)
void getAlphaFunc (AlphaFuncEnum &func, float &ref) const
void apply (sglCurrState *curr_state) const
virtual bool getSorted () const
virtual void printInfo (ostream &ostrm, const char *indent_string) const

Detailed Description

Statelet to control the alpha function test (glAlphaFunc), and the enable or disable [glEnable(GL_ALPHA_TEST)]. Constructor arguments allow you to enable/disable the test, choose the comparison test (e.g. GL_GREATER), and set the reference value. These can also be set with the setAlphaFunc(..) member functions after construction. The alpha function is disabled when the AlphaFuncEnum equal to sglAlphaTest::eALWAYS is chosen.


   sglAlphaTest *statelet = new sglAlphaTest;   // default eALWAYS
   statelet->setAlphaFunc(sglAlphaTest::eLEQUAL, 0.5f);

Definition at line 391 of file sglStatelet.hpp.

Member Enumeration Documentation

enum sglAlphaTest::AlphaFuncEnum

The list of possible alpha functions.

Definition at line 395 of file sglStatelet.hpp.

Constructor & Destructor Documentation

sglAlphaTest::sglAlphaTest ( AlphaFuncEnum func = eALWAYS,
float ref = 0.0f ) [inline]

Constructor (also default constructor).

func   One of the AlphaFuncEnum values. Defaults to eALWAYS.
ref   The floating point reference value for comparison. It is clamped to the range [0..1], and defaults to 0.

Definition at line 413 of file sglStatelet.hpp.

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

virtual destructor.

Definition at line 420 of file sglStatelet.hpp.

Member Function Documentation

void sglAlphaTest::setAlphaFunc ( AlphaFuncEnum func,
float ref )

Set the alpha test function and reference value.

func   One of the AlphaFuncEnum values.
ref   The floating point reference value for comparison. It is clamped to the range [0..1].

Referenced by sglAlphaTest().

void sglAlphaTest::getAlphaFunc ( AlphaFuncEnum & func,
float & ref ) const [inline]

Query the current alpha test function and reference value.

func   On return contains one of the enums corresponding to the test.
ref   On return contains the current reference value from zero to one.

Definition at line 435 of file sglStatelet.hpp.

void sglAlphaTest::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.

bool sglAlphaTest::getSorted ( ) const [inline, virtual]

Query the sorting mode for this statelet.

true if this type of statelet should be sorted by pointer rather than using m_index to index into an array. The defualt implementation is the latter, but if a statelet can take on an inordinate number of states (e.g. a floating point parameter) then true should be returned.

Reimplemented from sglStatelet.

Definition at line 442 of file sglStatelet.hpp.

virtual void sglAlphaTest::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:06 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001