added some code that doesn't do anything yet, waiting for ogre 1.8
parent
9ec1e55aaf
commit
f4898539e9
@ -0,0 +1,27 @@
|
||||
#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;
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
#ifndef _GAME_OCCLUSION_QUERY_H
|
||||
#define _GAME_OCCLUSION_QUERY_H
|
||||
|
||||
#include <OgreHardwareOcclusionQuery.h>
|
||||
|
||||
namespace MWRender
|
||||
{
|
||||
///
|
||||
/// \brief Implements hardware occlusion queries on the GPU
|
||||
///
|
||||
class OcclusionQuery
|
||||
{
|
||||
public:
|
||||
OcclusionQuery();
|
||||
|
||||
bool supported();
|
||||
///< returns true if occlusion queries are supported on the user's hardware
|
||||
|
||||
private:
|
||||
Ogre::HardwareOcclusionQuery* mSunTotalAreaQuery;
|
||||
Ogre::HardwareOcclusionQuery* mSunVisibleAreaQuery;
|
||||
|
||||
bool mSupported;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue