Revision 59,
1.3 KB
checked in by mattausch, 20 years ago
(diff) |
completely changed file structure plus software design
|
Rev | Line | |
---|
[59] | 1 | #include "OgrePlatformOcclusionQuery.h"
|
---|
| 2 |
|
---|
| 3 | namespace Ogre {
|
---|
| 4 |
|
---|
| 5 | //-----------------------------------------------------------------------
|
---|
| 6 | PlatformOcclusionQuery::PlatformOcclusionQuery(RenderSystem *rsys)
|
---|
| 7 | {
|
---|
| 8 | mHardwareOcclusionQuery = rsys->createHardwareOcclusionQuery();
|
---|
| 9 | }
|
---|
| 10 | //-----------------------------------------------------------------------
|
---|
| 11 | PlatformOcclusionQuery::~PlatformOcclusionQuery()
|
---|
| 12 | {
|
---|
| 13 | delete mHardwareOcclusionQuery;
|
---|
| 14 | }
|
---|
| 15 | //-----------------------------------------------------------------------
|
---|
| 16 | void PlatformOcclusionQuery::BeginQuery() const
|
---|
| 17 | {
|
---|
| 18 | mHardwareOcclusionQuery->beginOcclusionQuery();
|
---|
| 19 | }
|
---|
| 20 | //-----------------------------------------------------------------------
|
---|
| 21 | void PlatformOcclusionQuery::EndQuery() const
|
---|
| 22 | {
|
---|
| 23 | mHardwareOcclusionQuery->endOcclusionQuery();
|
---|
| 24 | }
|
---|
| 25 | //-----------------------------------------------------------------------
|
---|
| 26 | unsigned int PlatformOcclusionQuery::GetQueryResult() const
|
---|
| 27 | {
|
---|
| 28 | unsigned int visiblePixels = 0;
|
---|
| 29 | // wait if result not available
|
---|
| 30 | mHardwareOcclusionQuery->pullOcclusionQuery(&visiblePixels);
|
---|
| 31 |
|
---|
| 32 | return visiblePixels;
|
---|
| 33 | }
|
---|
| 34 | //-----------------------------------------------------------------------
|
---|
| 35 | bool PlatformOcclusionQuery::ResultAvailable() const
|
---|
| 36 | {
|
---|
| 37 | #ifdef GTP_VISIBILITY_MODIFIED_OGRE
|
---|
| 38 | return mHardwareOcclusionQuery->resultAvailable();
|
---|
| 39 | #else
|
---|
| 40 | return true;
|
---|
| 41 | #endif
|
---|
| 42 | }
|
---|
| 43 |
|
---|
| 44 | } // namespace Ogre |
---|
Note: See
TracBrowser
for help on using the repository browser.