All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Luminous::DepthMode Class Reference

This class defines the depth comparison mode used during rendering. More...

#include <Luminous/DepthMode.hpp>

Public Types

enum  Function {
  NEVER = GL_NEVER, LESS = GL_LESS, EQUAL = GL_EQUAL, LESS_EQUAL = GL_LEQUAL,
  GREATER = GL_GREATER, NOT_EQUAL = GL_NOTEQUAL, GREATER_EQUAL = GL_GEQUAL, ALWAYS = GL_ALWAYS
}
 Specifies the value used for depth buffer comparisons. More...
 

Public Member Functions

LUMINOUS_API DepthMode (Function function=LESS_EQUAL, Nimble::Rangef range=Nimble::Rangef(0.f, 1.f))
 Construct a new depth mode. More...
 
Function function () const
 Returns the function used in depth comparisons. More...
 
const Nimble::Rangefrange () const
 Get the mapping of depth values. More...
 
void setFunction (Function function)
 Set function for depth comparisons. More...
 
void setRange (const Nimble::Rangef &range)
 Specify the mapping of depth values from normalized device coordinates to window coordinates. More...
 

Static Public Member Functions

static DepthMode Default ()
 Default depth mode. More...
 

Detailed Description

This class defines the depth comparison mode used during rendering.

Member Enumeration Documentation

Specifies the value used for depth buffer comparisons.

See http://www.opengl.org/sdk/docs/man3/xhtml/glDepthFunc.xml for details.

Enumerator
NEVER 

Never pass comparison of depth test.

LESS 

Pass the incoming value if it is less than the stored value.

EQUAL 

Pass if the values are equal.

LESS_EQUAL 

Pass if the incoming value is less or equal.

GREATER 

Pass the incoming value if it is greeater than the stored value.

NOT_EQUAL 

Pass if the values are not equal.

GREATER_EQUAL 

Pass if the incoming value is greater or equal.

ALWAYS 

Pass always.

Constructor & Destructor Documentation

LUMINOUS_API Luminous::DepthMode::DepthMode ( Function  function = LESS_EQUAL,
Nimble::Rangef  range = Nimble::Rangef(0.f, 1.f) 
)

Construct a new depth mode.

Parameters
functiondepth test function
rangedepth range

Member Function Documentation

static DepthMode Luminous::DepthMode::Default ( )
inlinestatic

Default depth mode.

Returns
DepthMode with default settings
Function Luminous::DepthMode::function ( ) const
inline

Returns the function used in depth comparisons.

Returns
Function to use in comparisons
const Nimble::Rangef& Luminous::DepthMode::range ( ) const
inline

Get the mapping of depth values.

See Also
setRange
Returns
Current range used for depth values
void Luminous::DepthMode::setFunction ( Function  function)
inline

Set function for depth comparisons.

Parameters
functionFunction to use in comparisons
void Luminous::DepthMode::setRange ( const Nimble::Rangef range)
inline

Specify the mapping of depth values from normalized device coordinates to window coordinates.

See http://www.opengl.org/sdk/docs/man3/xhtml/glDepthRange.xml for details.

Parameters
rangeDepth range to use in window coordinates