source: GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformOcclusionQuery.cpp @ 2555

Revision 2555, 1.3 KB checked in by mattausch, 17 years ago (diff)

added partial implementation of chc++. problem: bounding box rendering in Ogre is VERY slow

RevLine 
[59]1#include "OgrePlatformOcclusionQuery.h"
[115]2#include <OgreLogManager.h>
[96]3
[59]4namespace Ogre {
5
6//-----------------------------------------------------------------------
7PlatformOcclusionQuery::PlatformOcclusionQuery(RenderSystem *rsys)
8{
9        mHardwareOcclusionQuery = rsys->createHardwareOcclusionQuery();
10}
11//-----------------------------------------------------------------------
12PlatformOcclusionQuery::~PlatformOcclusionQuery()
13{
[944]14        // hardwareocclusion query is deleted by Ogre
[903]15        //delete mHardwareOcclusionQuery;
[59]16}
17//-----------------------------------------------------------------------
[87]18void PlatformOcclusionQuery::BeginQuery()
[59]19{
20        mHardwareOcclusionQuery->beginOcclusionQuery();
21}
22//-----------------------------------------------------------------------
[87]23void PlatformOcclusionQuery::EndQuery()
[59]24{
25        mHardwareOcclusionQuery->endOcclusionQuery();
26}
27//-----------------------------------------------------------------------
[86]28bool PlatformOcclusionQuery::GetQueryResult(unsigned int &visiblePixels,
29                                                                                        const bool waitForResult) const
[59]30{
[2555]31        if (waitForResult || !mHardwareOcclusionQuery->isStillOutstanding())
[925]32        {
[2555]33                //return mHardwareOcclusionQuery->pullOcclusionQuery(&visiblePixels);
34                mHardwareOcclusionQuery->pullOcclusionQuery(&visiblePixels);
35                return true;
[925]36        }
37
38        return false;
[59]39}
40
41} // namespace Ogre
Note: See TracBrowser for help on using the repository browser.