Gem Illuminator
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
scenerenderer.h
Go to the documentation of this file.
1 #ifndef SCENERENDERER_H
2 #define SCENERENDERER_H
3 
4 #include <QObject>
5 #include <QOpenGLShaderProgram>
6 
7 #include "scene.h"
8 
9 class QOpenGLFunctions;
10 class QMatrix4x4;
11 
12 class AbstractGem;
13 class GemRenderer;
14 class LightRay;
15 class LightRayRenderer;
16 enum class ShaderPrograms;
17 
23 class SceneRenderer : public QObject
24 {
25  Q_OBJECT
26 
27 public:
32  explicit SceneRenderer(QObject *parent = 0);
33  virtual ~SceneRenderer();
34 
39  void cleanup(QOpenGLFunctions &gl);
40 
46 
51  void synchronizeLightRays(LightRay *rootLightRay);
52 
59  void paintGems(QOpenGLFunctions &gl, QOpenGLShaderProgram &shaderProgram);
66  void paintLightRays(QOpenGLFunctions &gl, const QMatrix4x4 &viewProjection, QOpenGLShaderProgram &shaderProgram);
67 
68 public slots:
75  void paint(QOpenGLFunctions &gl, const QMatrix4x4 &viewProjection, const QHash<ShaderPrograms, QOpenGLShaderProgram*> &shaderPrograms);
76 
77 signals:
81  void initalizationDone();
82 
83 protected:
84  void initalize(QOpenGLFunctions &gl);
85 
86 protected:
90 };
91 
92 #endif // SCENERENDERER_H
void synchronizeLightRays(LightRay *rootLightRay)
Synchronizes light rays between gui and render thread.
Definition: scenerenderer.cpp:69
The LightRay class describes the lightrays sent into Scene. Because LightRays are sent into Scene ri...
Definition: lightray.h:24
void cleanup(QOpenGLFunctions &gl)
Clears all used resources.
Definition: scenerenderer.cpp:29
SceneRenderer(QObject *parent=0)
SceneRenderer.
Definition: scenerenderer.cpp:14
void paintGems(QOpenGLFunctions &gl, QOpenGLShaderProgram &shaderProgram)
Paints the previous synchronized gems using specified program.
Definition: scenerenderer.cpp:52
void synchronizeGeometries(QList< AbstractGem * > geometries)
Synchronizes given gems between gui and render thread.
Definition: scenerenderer.cpp:62
virtual ~SceneRenderer()
Definition: scenerenderer.cpp:23
GemRenderer * m_gemRenderer
Definition: scenerenderer.h:87
The LightRayRenderer packs LightRays and paints them.
Definition: lightrayrenderer.h:18
bool m_isInitalized
Definition: scenerenderer.h:89
The SceneRenderer class Renders the scene: Packs the scene in the buffer and draws the scene in as f...
Definition: scenerenderer.h:23
The GemRenderer class renders all of our gems. For performance reasons the GemRenderer packs all gem...
Definition: gemrenderer.h:21
void paintLightRays(QOpenGLFunctions &gl, const QMatrix4x4 &viewProjection, QOpenGLShaderProgram &shaderProgram)
Paints previous synchronized light rays using specified program.
Definition: scenerenderer.cpp:57
void initalize(QOpenGLFunctions &gl)
Definition: scenerenderer.cpp:45
ShaderPrograms
The ShaderPrograms enum Manage ShaderPrograms with the help of this enum class. If it is neccessary ...
Definition: shaderprograms.h:14
LightRayRenderer * m_lightRayRenderer
Definition: scenerenderer.h:88
void initalizationDone()
This signal is emitted after initialization of all resources is done.
The AbstractGem class is the base class of all gems. As base class all required information of a gem...
Definition: abstractgem.h:39
void paint(QOpenGLFunctions &gl, const QMatrix4x4 &viewProjection, const QHash< ShaderPrograms, QOpenGLShaderProgram * > &shaderPrograms)
paint Paints the previous synchronized scene using specified programs.
Definition: scenerenderer.cpp:36