# 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:

List of all members.

## Public Member Functions

| HardwareOcclusionQuery ()
| Default object constructor.
virtual | ~HardwareOcclusionQuery ()
| Object destructor.
virtual void | beginOcclusionQuery ()=0
| Starts the hardware occlusion query 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, const HW_OCCLUSIONQUERY flag=HWOCCLUSIONQUERY_FLUSH)=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 bool | HardwareOcclusionQuery::isStillOutstanding (void)=0
| Lets you know when query is done, or still be processed by the Hardware.
virtual void | setSkipRate (int skip)=0
| This function allows you to set how often the hardware occlusion really are sent to the driver if you set it to 0 every hardware occlusion test is actually 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 Updated on 4/8/2005 by Tuan Kuranes email: tuan.kuranes@free.fr

Definition at line 50 of file OgreHardwareOcclusionQuery.h.

## Constructor & Destructor Documentation

Ogre::HardwareOcclusionQuery::HardwareOcclusionQuery | ( |  | ) |

| Default object constructor.

virtual Ogre::HardwareOcclusionQuery::~HardwareOcclusionQuery | ( |  | ) | `[virtual]`

| Object destructor.

## Member Function Documentation

virtual void Ogre::HardwareOcclusionQuery::beginOcclusionQuery | ( |  | ) | `[pure virtual]`

Starts the hardware occlusion query 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 directly after the first pass or frame. Objects not visible must be tested every frame, visible objects may be tested less frequently.

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::HardwareOcclusionQuery::isStillOutstanding | ( | void |  | ) | `[pure virtual]`

Lets you know when query is done, or still be processed by the Hardware.

Returns:
  true if query isn't finished.

virtual bool Ogre::HardwareOcclusionQuery::pullOcclusionQuery | ( | unsigned int * | NumOfFragments,
|  | const HW_OCCLUSIONQUERY | flag = HWOCCLUSIONQUERY_FLUSH
| ) | `[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. 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 void Ogre::HardwareOcclusionQuery::setSkipRate | ( | int | skip | ) | `[pure virtual]`

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

If you set it to 1 only the half of your queries are sent for all visible objects. 2 will result in 25% of all queries to actually be sent. New and none visible objects will be tested all the time. This functionality is here because this class can keep track on visible and none visible 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 file:

- OgreHardwareOcclusionQuery.h

Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Feb 12 13:00:41 2006