#include "OgrePlatformOcclusionQuery.h" namespace Ogre { //----------------------------------------------------------------------- PlatformOcclusionQuery::PlatformOcclusionQuery(RenderSystem *rsys) { mHardwareOcclusionQuery = rsys->createHardwareOcclusionQuery(); } //----------------------------------------------------------------------- PlatformOcclusionQuery::~PlatformOcclusionQuery() { delete mHardwareOcclusionQuery; } //----------------------------------------------------------------------- void PlatformOcclusionQuery::BeginQuery() const { mHardwareOcclusionQuery->beginOcclusionQuery(); } //----------------------------------------------------------------------- void PlatformOcclusionQuery::EndQuery() const { mHardwareOcclusionQuery->endOcclusionQuery(); } //----------------------------------------------------------------------- unsigned int PlatformOcclusionQuery::GetQueryResult() const { unsigned int visiblePixels = 0; // wait if result not available mHardwareOcclusionQuery->pullOcclusionQuery(&visiblePixels); return visiblePixels; } //----------------------------------------------------------------------- bool PlatformOcclusionQuery::ResultAvailable() const { #ifdef GTP_VISIBILITY_MODIFIED_OGRE return mHardwareOcclusionQuery->resultAvailable(); #else return true; #endif } } // namespace Ogre