1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-07 03:12:36 +01:00
openrw/rwviewer/views/ViewerInterface.hpp

40 lines
751 B
C++
Raw Normal View History

#ifndef _RWVIEWER_VIEWERINTERFACE_HPP_
#define _RWVIEWER_VIEWERINTERFACE_HPP_
#include <engine/GameWorld.hpp>
#include <ViewerWidget.hpp>
#include <QWidget>
2016-09-09 22:13:21 +02:00
class ViewerInterface : public QWidget {
Q_OBJECT
public:
2016-09-09 22:13:21 +02:00
ViewerInterface(QWidget* parent = 0, Qt::WindowFlags f = 0)
: QWidget(parent, f), m_world(nullptr) {
}
2016-09-09 22:13:21 +02:00
GameWorld* world() {
return m_world;
}
protected:
virtual void worldChanged() {}
ViewerWidget* createViewer();
signals:
void gameLoaded(GameWorld*, GameRenderer*);
public slots:
void showData(GameWorld* world, GameRenderer* renderer) {
2016-09-09 22:13:21 +02:00
m_world = world;
gameLoaded(world, renderer);
2016-09-09 22:13:21 +02:00
worldChanged();
}
private:
2016-09-09 22:13:21 +02:00
GameWorld* m_world;
};
#endif