mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 13:19:54 +00:00
27 lines
720 B
C++
27 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;
|
|
}
|