source: trunk/VUT/Ogre/src/OgrePlatformOcclusionQuery.cpp @ 59

Revision 59, 1.3 KB checked in by mattausch, 20 years ago (diff)

completely changed file structure plus software design

Line 
1#include "OgrePlatformOcclusionQuery.h"
2
3namespace Ogre {
4
5//-----------------------------------------------------------------------
6PlatformOcclusionQuery::PlatformOcclusionQuery(RenderSystem *rsys)
7{
8        mHardwareOcclusionQuery = rsys->createHardwareOcclusionQuery();
9}
10//-----------------------------------------------------------------------
11PlatformOcclusionQuery::~PlatformOcclusionQuery()
12{
13        delete mHardwareOcclusionQuery;
14}
15//-----------------------------------------------------------------------
16void PlatformOcclusionQuery::BeginQuery() const
17{
18        mHardwareOcclusionQuery->beginOcclusionQuery();
19}
20//-----------------------------------------------------------------------
21void PlatformOcclusionQuery::EndQuery() const
22{
23        mHardwareOcclusionQuery->endOcclusionQuery();
24}
25//-----------------------------------------------------------------------
26unsigned 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//-----------------------------------------------------------------------
35bool 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.