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

Ogre::HardwareOcclusionQuery Class Reference

This is a abstract class that that provides the interface for the query class for hardware occlusion. More...

#include <OgreHardwareOcclusionQuery.h>

Inheritance diagram for Ogre::HardwareOcclusionQuery:

Inheritance graph
[legend]
List of all members.

Public Methods

 HardwareOcclusionQuery ()
 Default object constructor.

virtual ~HardwareOcclusionQuery ()
 Object destructor.

virtual void beginOcclusionQuery ()=0
 Starts the hardware occlusion query @Remarks Simple usage: Create one or more OcclusionQuery object one per outstanding query or one per tested object OcclusionQuery* m_pOcclusionQuery; createOcclusionQuery( &m_pOcclusionQuery ); In the rendering loop: Draw all occluders m_pOcclusionQuery->startOcclusionQuery(); Draw the polygons to be tested m_pOcclusionQuery->endOcclusionQuery();.

virtual void endOcclusionQuery ()=0
 Ends the hardware occlusion test.

virtual bool pullOcclusionQuery (unsigned int *NumOfFragments)=0
 Pulls the hardware occlusion query too see if there is a result.

virtual bool pullOcclusionQuery (unsigned int *NumOfFragments, const HW_OCCLUSIONQUERY flag)=0
 Pulls the hardware occlusion query too see if there is a result.

virtual unsigned int getLastQuerysPixelcount ()=0
 Let's you get the last pixel count with out doing the hardware occlusion test.

virtual void setSkipRate (int skip)=0
 @Remarks This function allows you to set how often the hardware occlusion really are sent to the driver if you set it to 0 every hw occlusion test is acctually made.

virtual int getSkipRate ()=0

Detailed Description

This is a abstract class that that provides the interface for the query class for hardware occlusion.

Author:
Lee Sandberg

Definition at line 49 of file OgreHardwareOcclusionQuery.h.


Constructor & Destructor Documentation

Ogre::HardwareOcclusionQuery::HardwareOcclusionQuery  
 

Default object constructor.

Definition at line 32 of file OgreHardwareOcclusionQuery.cpp.

Ogre::HardwareOcclusionQuery::~HardwareOcclusionQuery   [virtual]
 

Object destructor.

Definition at line 35 of file OgreHardwareOcclusionQuery.cpp.


Member Function Documentation

virtual void Ogre::HardwareOcclusionQuery::beginOcclusionQuery   [pure virtual]
 

Starts the hardware occlusion query @Remarks Simple usage: Create one or more OcclusionQuery object one per outstanding query or one per tested object OcclusionQuery* m_pOcclusionQuery; createOcclusionQuery( &m_pOcclusionQuery ); In the rendering loop: Draw all occluders m_pOcclusionQuery->startOcclusionQuery(); Draw the polygons to be tested m_pOcclusionQuery->endOcclusionQuery();.

Results must be pulled using: UINT m_uintNumberOfPixelsVisable; pullOcclusionQuery( &m_dwNumberOfPixelsVisable ); You may not get the result directlly after the first pass or frame. Objects not visable must be tested every frame, visable objects may be tested less freqvent.

Implemented in Ogre::D3D9HardwareOcclusionQuery, and Ogre::GLHardwareOcclusionQuery.

virtual void Ogre::HardwareOcclusionQuery::endOcclusionQuery   [pure virtual]
 

Ends the hardware occlusion test.

Implemented in Ogre::D3D9HardwareOcclusionQuery, and Ogre::GLHardwareOcclusionQuery.

virtual unsigned int Ogre::HardwareOcclusionQuery::getLastQuerysPixelcount   [pure virtual]
 

Let's you get the last pixel count with out doing the hardware occlusion test.

Returns:
The last fragment count from the last test. Remarks This function won't give you new values, just the old value.

Implemented in Ogre::D3D9HardwareOcclusionQuery, and Ogre::GLHardwareOcclusionQuery.

virtual int Ogre::HardwareOcclusionQuery::getSkipRate   [pure virtual]
 

Implemented in Ogre::D3D9HardwareOcclusionQuery, and Ogre::GLHardwareOcclusionQuery.

virtual bool Ogre::HardwareOcclusionQuery::pullOcclusionQuery unsigned int *    NumOfFragments,
const HW_OCCLUSIONQUERY    flag
[pure virtual]
 

Pulls the hardware occlusion query too see if there is a result.

Return values:
NumOfFragments  will get the resulting number of fragments.
Returns:
True if success or false if not. @Remarks In DX9 mode specifying OCCLUSIONQUERY_FLUSH as the flag, will case the driver to flush whatever API calls are batched. In OpenGL mode it makes no difference if you specify OCCLUSIONQUERY_FLUSH or OCCLUSIONQUERY_NOFLUSH.

Implemented in Ogre::D3D9HardwareOcclusionQuery, and Ogre::GLHardwareOcclusionQuery.

virtual bool Ogre::HardwareOcclusionQuery::pullOcclusionQuery unsigned int *    NumOfFragments [pure virtual]
 

Pulls the hardware occlusion query too see if there is a result.

Return values:
NumOfFragments  will get the resulting number of fragments.
Returns:
True if success or false if not. @Remarks Hardware occlusion is an assyncronius process the result may take a frame or so. one idea is to test pass1 and if not visable skip pass2. Also note that objects not visable must be tested evrey frame. Visable objects don't need testing every frame. Testing non visable objects can be don unlit, no texture with low LOD object. 0 will generate all the levels till 1x1. [default: 0]

Implemented in Ogre::D3D9HardwareOcclusionQuery, and Ogre::GLHardwareOcclusionQuery.

virtual void Ogre::HardwareOcclusionQuery::setSkipRate int    skip [pure virtual]
 

@Remarks This function allows you to set how often the hardware occlusion really are sent to the driver if you set it to 0 every hw occlusion test is acctually made.

If you set it to 1 only the half of your queries are sent for all visable objects. 2 will result in 25% of all queries to acctualy be sent. New and none visable objects will be tested all the time. This functionality is here because this class can keep track on visable and none visable objects for you. Once you you set the SkipRate for any hardware occlusion instance it effects all others.

Implemented in Ogre::D3D9HardwareOcclusionQuery, and Ogre::GLHardwareOcclusionQuery.


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

Copyright © 2002-2003 by The OGRE Team
Last modified Fri May 14 23:26:20 2004