-
Notifications
You must be signed in to change notification settings - Fork 0
/
ogrewidget.h
54 lines (43 loc) · 1.31 KB
/
ogrewidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef __OGREWIDGET_H__
#define __OGREWIDGET_H__
#include <QTimer>
#include <QHash>
#include <QMetaType>
#include <OGRE/Ogre.h>
#include <QGLWidget>
#include <QDebug>
Q_DECLARE_METATYPE(Ogre::Root *);
Q_DECLARE_METATYPE(Ogre::RenderWindow *);
Q_DECLARE_METATYPE(Ogre::Camera *);
Q_DECLARE_METATYPE(Ogre::Viewport *);
Q_DECLARE_METATYPE(Ogre::SceneManager *);
class OgreWidget : public QGLWidget
{
Q_OBJECT
public:
OgreWidget(QObject *parent = 0);
virtual ~OgreWidget(void);
void initRender(QString pluginPath = QString("plugins.cfg"),
QString configPath = QString(""),
QString logPath = QString("log.cfg"),
QString resPath = QString("resources.cfg"),
QString renderSys = QString("OpenGL Rendering Subsystem"),
QHash<QString, QString> renderSysConf = QHash<QString, QString>());
void stopRender();
protected:
virtual void initializeGL();
virtual void resizeGL(int, int);
virtual void paintGL();
void init(std::string, std::string, std::string);
Ogre::Root *m_ogreRoot;
Ogre::RenderWindow *m_ogreWindow;
Ogre::Camera *m_ogreCamera;
Ogre::Viewport *m_ogreViewport;
Ogre::SceneManager *m_ogreSceneMgr;
private:
bool m_isInit;
QTimer m_timer;
signals:
void ogreWidgetReady(Ogre::Root *, Ogre::RenderWindow *, Ogre::Camera *, Ogre::Viewport *, Ogre::SceneManager *);
};
#endif