2015-04-12 15:34:50 +02:00
|
|
|
#ifndef OPENMW_MWRENDER_RENDERINGMANAGER_H
|
|
|
|
#define OPENMW_MWRENDER_RENDERINGMANAGER_H
|
2011-10-20 15:02:19 -04:00
|
|
|
|
2015-04-12 15:34:50 +02:00
|
|
|
#include <osg/ref_ptr>
|
|
|
|
#include <osg/Light>
|
2011-11-12 00:19:22 -05:00
|
|
|
|
2015-04-12 15:34:50 +02:00
|
|
|
#include "objects.hpp"
|
2013-02-03 18:03:09 +01:00
|
|
|
|
2011-11-12 00:19:22 -05:00
|
|
|
#include "renderinginterface.hpp"
|
2011-11-24 01:48:54 -05:00
|
|
|
|
2015-04-12 15:34:50 +02:00
|
|
|
namespace osg
|
2011-10-20 18:15:30 -04:00
|
|
|
{
|
2015-04-12 15:34:50 +02:00
|
|
|
class Group;
|
2011-10-20 18:15:30 -04:00
|
|
|
}
|
|
|
|
|
2015-04-12 15:34:50 +02:00
|
|
|
namespace Resource
|
2011-10-20 15:02:19 -04:00
|
|
|
{
|
2015-04-12 15:34:50 +02:00
|
|
|
class ResourceSystem;
|
2011-10-20 18:15:30 -04:00
|
|
|
}
|
2011-10-20 15:02:19 -04:00
|
|
|
|
2015-04-12 15:34:50 +02:00
|
|
|
namespace osgViewer
|
2012-07-03 22:48:16 +02:00
|
|
|
{
|
2015-04-12 15:34:50 +02:00
|
|
|
class Viewer;
|
2012-07-03 22:48:16 +02:00
|
|
|
}
|
|
|
|
|
2015-04-12 15:34:50 +02:00
|
|
|
namespace ESM
|
2013-08-16 13:01:52 +02:00
|
|
|
{
|
2015-04-12 15:34:50 +02:00
|
|
|
struct Cell;
|
2013-08-16 13:01:52 +02:00
|
|
|
}
|
|
|
|
|
2011-10-20 18:15:30 -04:00
|
|
|
namespace MWRender
|
|
|
|
{
|
2012-08-12 15:50:37 +04:00
|
|
|
|
2015-04-14 15:55:56 +02:00
|
|
|
class StateUpdater;
|
|
|
|
|
|
|
|
class SkyManager;
|
|
|
|
|
2015-04-12 15:34:50 +02:00
|
|
|
class RenderingManager : public MWRender::RenderingInterface
|
2013-04-29 05:50:40 -07:00
|
|
|
{
|
2015-04-12 15:34:50 +02:00
|
|
|
public:
|
|
|
|
RenderingManager(osgViewer::Viewer& viewer, osg::ref_ptr<osg::Group> rootNode, Resource::ResourceSystem* resourceSystem);
|
2015-04-14 15:55:56 +02:00
|
|
|
~RenderingManager();
|
2014-01-17 10:52:44 +01:00
|
|
|
|
2015-04-12 15:34:50 +02:00
|
|
|
MWRender::Objects& getObjects();
|
|
|
|
MWRender::Actors& getActors();
|
2013-04-29 03:31:46 -07:00
|
|
|
|
2015-04-12 15:34:50 +02:00
|
|
|
Resource::ResourceSystem* getResourceSystem();
|
2011-11-03 23:47:15 -04:00
|
|
|
|
2015-04-14 15:55:56 +02:00
|
|
|
void setAmbientColour(const osg::Vec4f& colour);
|
|
|
|
|
|
|
|
void setSunDirection(const osg::Vec3f& direction);
|
|
|
|
void setSunColour(const osg::Vec4f& colour);
|
|
|
|
|
2015-04-12 15:34:50 +02:00
|
|
|
void configureAmbient(const ESM::Cell* cell);
|
2011-11-02 00:13:33 -04:00
|
|
|
|
2015-04-14 15:55:56 +02:00
|
|
|
void configureFog(float fogDepth, const osg::Vec4f& colour);
|
|
|
|
|
2015-04-12 15:34:50 +02:00
|
|
|
void removeCell(const MWWorld::CellStore* store);
|
2013-02-27 09:20:42 +01:00
|
|
|
|
2015-04-14 15:55:56 +02:00
|
|
|
void setSkyEnabled(bool enabled);
|
|
|
|
|
|
|
|
SkyManager* getSkyManager();
|
|
|
|
|
2015-04-12 15:34:50 +02:00
|
|
|
osg::Vec3f getEyePos();
|
2011-11-02 00:13:33 -04:00
|
|
|
|
2015-04-19 01:57:52 +02:00
|
|
|
void update(float dt, bool paused);
|
|
|
|
|
2015-04-12 15:34:50 +02:00
|
|
|
private:
|
|
|
|
osgViewer::Viewer& mViewer;
|
|
|
|
osg::ref_ptr<osg::Group> mRootNode;
|
|
|
|
Resource::ResourceSystem* mResourceSystem;
|
2012-03-29 13:27:13 +04:00
|
|
|
|
2015-04-12 15:34:50 +02:00
|
|
|
osg::ref_ptr<osg::Light> mSunLight;
|
2012-04-11 18:53:13 +02:00
|
|
|
|
2015-04-12 15:34:50 +02:00
|
|
|
std::auto_ptr<Objects> mObjects;
|
2015-04-14 15:55:56 +02:00
|
|
|
std::auto_ptr<SkyManager> mSky;
|
|
|
|
|
|
|
|
osg::ref_ptr<StateUpdater> mStateUpdater;
|
|
|
|
|
|
|
|
void operator = (const RenderingManager&);
|
|
|
|
RenderingManager(const RenderingManager&);
|
2015-04-12 15:34:50 +02:00
|
|
|
};
|
2011-10-20 15:02:19 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|