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