added some code that doesn't do anything yet, waiting for ogre 1.8

actorid
scrawl 13 years ago
parent 9ec1e55aaf
commit f4898539e9

@ -15,7 +15,7 @@ source_group(game FILES ${GAME} ${GAME_HEADER})
add_openmw_dir (mwrender
renderingmanager debugging sky player animation npcanimation creatureanimation actors objects
renderinginterface localmap
renderinginterface localmap occlusionquery
)
add_openmw_dir (mwinput

@ -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

@ -49,6 +49,8 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const
Ogre::SceneNode *cameraYawNode = playerNode->createChildSceneNode();
Ogre::SceneNode *cameraPitchNode = cameraYawNode->createChildSceneNode();
cameraPitchNode->attachObject(mRendering.getCamera());
mOcclusionQuery = new OcclusionQuery();
//mSkyManager = 0;
mSkyManager = new SkyManager(mMwRoot, mRendering.getCamera(), &environment);
@ -65,6 +67,7 @@ RenderingManager::~RenderingManager ()
delete mPlayer;
delete mSkyManager;
delete mLocalMap;
delete mOcclusionQuery;
}
MWRender::SkyManager* RenderingManager::getSkyManager()

@ -25,6 +25,7 @@
#include "actors.hpp"
#include "player.hpp"
#include "localmap.hpp"
#include "occlusionquery.hpp"
namespace Ogre
{
@ -131,9 +132,11 @@ class RenderingManager: private RenderingInterface {
private:
void setAmbientMode();
SkyManager* mSkyManager;
OcclusionQuery* mOcclusionQuery;
OEngine::Render::OgreRenderer &mRendering;
MWRender::Objects mObjects;

Loading…
Cancel
Save