PixelLightAPI
.
|
Abstract renderer occlusion query. More...
#include <OcclusionQuery.h>
Public Member Functions | |
virtual PLRENDERER_API | ~OcclusionQuery () |
Destructor. | |
virtual bool | BeginOcclusionQuery ()=0 |
Starts the hardware occlusion query. | |
virtual void | EndOcclusionQuery ()=0 |
Ends the hardware occlusion query. | |
virtual bool | PullOcclusionQuery (PLCore::uint32 *pnNumOfFragments=nullptr)=0 |
Pulls the hardware occlusion query too see if there is a result. | |
virtual PLCore::uint32 | GetLastQuerysPixelCount () const =0 |
Returns the number of the last occlusion query visible fragments. | |
virtual PLCore::uint32 | GetSkipRate () const =0 |
Returns the skip rate. | |
virtual void | SetSkipRate (PLCore::uint32 nRate=0)=0 |
Sets the skip rate. | |
virtual PLCore::uint32 | GetMinFragments () const =0 |
Gets the minimum number of visible fragments. | |
virtual void | SetMinFragments (PLCore::uint32 nMinFragments=0)=0 |
Sets the minimum number of visible fragments. | |
Protected Member Functions | |
PLRENDERER_API | OcclusionQuery (Renderer &cRenderer) |
Constructor. |
Abstract renderer occlusion query.
* Usage example: * Create one or more OcclusionQuery object one per outstanding * query or one per tested object. * * OcclusionQuery *pOcclusionQuery = cRenderer.CreateOcclusionQuery(); * // In the rendering loop: * // Draw all occludes * pOcclusionQuery->BeginOcclusionQuery(); * // Draw the polygons to be tested * pOcclusionQuery->EndOcclusionQuery(); * // Do something useful to give the GPU some time to process the stuff * // Results must be pulled using: * PLCore::uint32 nNumberOfVisibleFragments; * if (!pOcclusionQuery->PullOcclusionQuery(&nNumberOfVisibleFragments)) { * if (nNumberOfVisibleFragments >= pOcclusionQuery->GetMinFragments()) { * // Our object is visible (or visible enough ;-) * } * } else { * // The result isn't available yet! We still have to wait for it... * } *
virtual PLRENDERER_API PLRenderer::OcclusionQuery::~OcclusionQuery | ( | ) | [virtual] |
Destructor.
PLRENDERER_API PLRenderer::OcclusionQuery::OcclusionQuery | ( | Renderer & | cRenderer | ) | [protected] |
Constructor.
[in] | cRenderer | The owner renderer |
virtual bool PLRenderer::OcclusionQuery::BeginOcclusionQuery | ( | ) | [pure virtual] |
Starts the hardware occlusion query.
virtual void PLRenderer::OcclusionQuery::EndOcclusionQuery | ( | ) | [pure virtual] |
Ends the hardware occlusion query.
virtual bool PLRenderer::OcclusionQuery::PullOcclusionQuery | ( | PLCore::uint32 * | pnNumOfFragments = nullptr | ) | [pure virtual] |
Pulls the hardware occlusion query too see if there is a result.
[out] | pnNumOfFragments | If not a null pointer it will receive the number of visible fragments |
virtual PLCore::uint32 PLRenderer::OcclusionQuery::GetLastQuerysPixelCount | ( | ) | const [pure virtual] |
Returns the number of the last occlusion query visible fragments.
virtual PLCore::uint32 PLRenderer::OcclusionQuery::GetSkipRate | ( | ) | const [pure virtual] |
Returns the skip rate.
virtual void PLRenderer::OcclusionQuery::SetSkipRate | ( | PLCore::uint32 | nRate = 0 | ) | [pure virtual] |
virtual PLCore::uint32 PLRenderer::OcclusionQuery::GetMinFragments | ( | ) | const [pure virtual] |
Gets the minimum number of visible fragments.
virtual void PLRenderer::OcclusionQuery::SetMinFragments | ( | PLCore::uint32 | nMinFragments = 0 | ) | [pure virtual] |
Sets the minimum number of visible fragments.
[in] | nMinFragments | Minimum number of visible fragments |
|