1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 10:49:57 +00:00
openmw-tes3mp/apps/opencs/view/render/scenewidget.hpp
scrawl d6dea31b88 OpenCS: Use a CompositeViewer with multiple views instead of multiple viewers
Fixes the rendering glitches, turns out that multiple osgViewers were never an intended use case.
2015-03-23 15:55:57 +01:00

68 lines
1.1 KiB
C++

#ifndef OPENCS_VIEW_SCENEWIDGET_H
#define OPENCS_VIEW_SCENEWIDGET_H
#include <QWidget>
#include <QTimer>
#include "lightingday.hpp"
#include "lightingnight.hpp"
#include "lightingbright.hpp"
#include <osgViewer/View>
#include <osgViewer/CompositeViewer>
namespace osg
{
class Group;
}
namespace CSVWidget
{
class SceneToolMode;
class SceneToolbar;
}
namespace CSVRender
{
class Navigation;
class Lighting;
class SceneWidget : public QWidget
{
Q_OBJECT
public:
SceneWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
~SceneWidget();
void flagAsModified();
protected:
osg::ref_ptr<osgViewer::View> mView;
osg::Group* mRootNode;
QTimer mTimer;
};
// There are rendering glitches when using multiple Viewer instances, work around using CompositeViewer with multiple views
class CompositeViewer : public QObject, public osgViewer::CompositeViewer
{
Q_OBJECT
public:
CompositeViewer();
static CompositeViewer& get();
QTimer mTimer;
public slots:
void update();
};
}
#endif