mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 10:49:57 +00:00
d6dea31b88
Fixes the rendering glitches, turns out that multiple osgViewers were never an intended use case.
68 lines
1.1 KiB
C++
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
|