Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Class Members

DepthTest Class Reference
[Scene Graph]

#include <lvt/State.h>

Inheritance diagram for DepthTest:

Inheritance graph
[legend]
List of all members.

Detailed Description

Controls depth testing.

The DepthTest class controls both depth testing and writes to the depth buffer. Disabling the class (via State::Disable) will disable both depth testing and depth writes. To disable depth testing, but leave depth writes enabled, set the depth test function to GL_ALWAYS:

    DepthTest *dt = new DepthTest;
    dt->SetDepthFunc(GL_ALWAYS);


Public Member Functions

 DepthTest (GLenum func=GL_LESS, bool doWrites=true)
 Default constructor.
bool DepthWritesEnabled () const
 Returns true if Depth buffer writes are enabled.
void DisableDepthWrites ()
 Disables writes to the depth buffer.
void EnableDepthWrites ()
 Enables writes to the depth buffer.
virtual void Render ()
 Activates the State.
GLenum SetDepthFunc (GLenum func) const
 Returns the current depth test function.
void SetDepthFunc (GLenum func)
 Sets the depth test.


Constructor & Destructor Documentation

DepthTest GLenum  func = GL_LESS,
bool  doWrites = true
[inline]
 

Default constructor.


Member Function Documentation

bool DepthWritesEnabled  )  const [inline]
 

Returns true if Depth buffer writes are enabled.

void DisableDepthWrites  )  [inline]
 

Disables writes to the depth buffer.

void EnableDepthWrites  )  [inline]
 

Enables writes to the depth buffer.

virtual void Render  )  [virtual]
 

Activates the State.

If the State is enabled, the corresponding piece of OpenGL state is enabled and its value is set, if appropriate. If the State object is disabled, the corresponding piece of OpenGL state is disabled.

Implements State.

GLenum SetDepthFunc GLenum  func  )  const [inline]
 

Returns the current depth test function.

void SetDepthFunc GLenum  func  )  [inline]
 

Sets the depth test.

Parameters:
func Specifies the depth test function.
See the glDepthFunc man page, or the OpenGL Red Book for more information about depth testing. The default function is GL_LESS.


Generated on Thu Feb 17 09:45:47 2005 for liblvt by  doxygen 1.4.1