blob: 83cb63abaeed3d528e13953a40bb9f4bf7e3cac2 (
plain)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
#ifndef OGRENODE_H
#define OGRENODE_H
#include <QSGGeometryNode>
#include "qsgtexturematerial.h"
#include <private/qsgtexture_p.h>
#include <OgreTexture.h>
#define STRINGIFY_(x) #x
#define STRINGIFY(x) STRINGIFY_(x)
#define OGRE_PLUGIN_DIR STRINGIFY(OGRE_PLUGIN_VAR)
namespace Ogre {
class Root;
class Camera;
class SceneManager;
class RenderTexture;
class Viewport;
class RenderTarget;
}
class CameraNodeObject;
class OgreNode : public QSGGeometryNode
{
public:
OgreNode();
~OgreNode();
void setSize(const QSize &size);
QSize size() const { return m_size; }
void setAAEnabled(bool enable);
CameraNodeObject *camera() const { return m_cameraObject; }
void update();
void updateFBO();
void init();
GLuint getOgreFBO();
void saveOgreState();
void restoreOgreState();
void preprocess();
private:
QSGTextureMaterial m_material;
QSGTextureMaterialWithOpacity m_materialO;
QSGGeometry m_geometry;
QSGPlainTexture *m_texture;
int m_samples;
bool m_AAEnabled;
QSize m_size;
Ogre::Root *m_root;
Ogre::Camera *m_camera;
Ogre::SceneManager *m_sceneManager;
Ogre::RenderTexture *m_renderTexture;
Ogre::Viewport *m_viewport;
Ogre::TexturePtr rtt_texture;
Ogre::RenderWindow *m_window;
GLuint m_ogreFBO;
CameraNodeObject *m_cameraObject;
bool m_initialized;
bool m_dirtyFBO;
};
#endif // OGRENODE_H
|