version 3.3

VRS::OcclusionQueryGL Class Reference

Class for testing the visibility of shapes rendered by OpenGL. More...

#include <vrs/opengl/occlusionquerygl.h>

Inheritance diagram for VRS::OcclusionQueryGL:

VRS::MonoAttribute VRS::Attribute VRS::RenderObj VRS::SharedObj VRS::Visitable

List of all members.

Public Types

enum  QueryMode { QM_ImmediateMode, QM_DelayedMode }
enum  SupportedVersion { SV_OGL15, SV_ARB, SV_NV, SV_NotSupported }

Public Member Functions

 VRS_SERIALIZABLE_CLASS_ENUM (QueryMode)
 OcclusionQueryGL (QueryMode mode=OcclusionQueryGL::QM_ImmediateMode)
virtual ~OcclusionQueryGL ()
bool isSupported () const
bool isAvailable () const
unsigned int fragmentCount () const
unsigned int getQueryID (void) const
 VRS_TYPEINFO (OcclusionQueryGL, MonoAttribute)

Friends

class OcclusionQueryPainterGL


Detailed Description

Class for testing the visibility of shapes rendered by OpenGL.

Member Enumeration Documentation

Enumerator:
QM_ImmediateMode 
QM_DelayedMode 

Enumerator:
SV_OGL15 
SV_ARB 
SV_NV 
SV_NotSupported 


Constructor & Destructor Documentation

VRS::OcclusionQueryGL::OcclusionQueryGL ( QueryMode  mode = OcclusionQueryGL::QM_ImmediateMode  ) 

An OcclusionQuery object can be used to count the number of fragments that pass the z-test during the application of this attribute (i.e. between pushing and popping to/from the rendering engine). This attribute relies on the OpenGL extension GL_ARB_occlusion_query or the older GL_NV_occlusion_query. If one of these extension is available at runtime or not can be queried by the method isSupported() *after* the application of the attribute. If the needed extension is not available at runtime it is always indicated that a z-test has been passed successfully and the fragment count will be UINT_MAX. If the query mode is QM_ImmediateMode, the result will be available directly after popping the attribute, which may lead to a stall in the OpenGL command pipeline. The QM_DelayedMode allows to query the result at a later time, but you should be sure, that the current OpenGL rendering context is the same, when querying the result!

virtual VRS::OcclusionQueryGL::~OcclusionQueryGL (  )  [virtual]


Member Function Documentation

VRS::OcclusionQueryGL::VRS_SERIALIZABLE_CLASS_ENUM ( QueryMode   ) 

bool VRS::OcclusionQueryGL::isSupported (  )  const

Returns true if the needed OpenGL extension GL_ARB_occlusion_query or GL_NV_occlusion_query was available (which can be queried after pushing the attribute to the engine).

bool VRS::OcclusionQueryGL::isAvailable (  )  const

Returns true if the result of the occlusion query is already available (always the case for QM_ImmediateMode or when the GL_ARB_occlusion_query or GL_NV_occlusion_query extension is not supported).

unsigned int VRS::OcclusionQueryGL::fragmentCount (  )  const

Return the number of fragments for that the z-test has been passed. If the GL_ARB_occlusion_query extension is not supported, the returned value is UINT_MAX. For the QM_DelayedMode you must ensure that the correct OpenGL rendering context is current!

unsigned int VRS::OcclusionQueryGL::getQueryID ( void   )  const [inline]

VRS::OcclusionQueryGL::VRS_TYPEINFO ( OcclusionQueryGL  ,
MonoAttribute   
)


Friends And Related Function Documentation

friend class OcclusionQueryPainterGL [friend]


The documentation for this class was generated from the following file:

Generated on Tue May 22 06:00:24 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact