1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 06:39:49 +00:00
OpenMW/apps/openmw/mwrender/occlusionquery.cpp

28 lines
720 B
C++

#include "occlusionquery.hpp"
#include <OgreRenderSystem.h>
#include <OgreRoot.h>
using namespace MWRender;
using namespace Ogre;
OcclusionQuery::OcclusionQuery() :
mSunTotalAreaQuery(0), mSunVisibleAreaQuery(0)
{
try {
RenderSystem* renderSystem = Root::getSingleton().getRenderSystem();
mSunTotalAreaQuery = renderSystem->createHardwareOcclusionQuery();
mSunVisibleAreaQuery = renderSystem->createHardwareOcclusionQuery();
mSupported = (mSunTotalAreaQuery != 0) && (mSunVisibleAreaQuery != 0);
}
catch (Ogre::Exception e)
{
mSupported = false;
}
if (!mSupported)
std::cout << "Hardware occlusion queries not supported." << std::endl;
}