Gem Illuminator
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
environmentmap.h
Go to the documentation of this file.
1 #ifndef ENVIRONMENTMAP_H
2 #define ENVIRONMENTMAP_H
3 
4 #include <QObject>
5 
6 class QOpenGLFunctions;
7 class QOpenGLShaderProgram;
8 
9 class Camera;
10 class CubeMap;
11 class ScreenAlignedQuad;
12 
16 class EnvironmentMap : public QObject
17 {
18  Q_OBJECT
19 public:
26  EnvironmentMap(QOpenGLFunctions &gl, QString cubeMapPrefix, QObject *parent = 0);
28 
33  void paint(const Camera &camera);
34 
40  void update(QString newCubeMapPrefix);
41 
46  uint cubeMapTexture();
47 
48 protected:
49  void initialize();
51 
52 protected:
55  QOpenGLFunctions &m_gl;
57  QOpenGLShaderProgram *m_shaderProgram;
58 };
59 
60 #endif // ENVIRONMENTMAP_H
void update(QString newCubeMapPrefix)
Replace current CubeMap with new one specified by name.
Definition: environmentmap.cpp:56
QOpenGLShaderProgram * m_shaderProgram
Definition: environmentmap.h:57
void initializeShaderProgram()
Definition: environmentmap.cpp:76
The EnvironmentMap is a CubeMap based rendering technique for showing some scene enviroment.
Definition: environmentmap.h:16
The CubeMap class loads cubemap textures and provides them as OpenGL-texture.
Definition: cubemap.h:11
ScreenAlignedQuad * m_quad
Definition: environmentmap.h:56
The Camera class provides view and perspective projection matrices. Additional the viewport of camera...
Definition: camera.h:16
uint cubeMapTexture()
OpenGL texture that is used for drawing.
Definition: environmentmap.cpp:61
CubeMap * m_cubeMap
Definition: environmentmap.h:53
void initialize()
Definition: environmentmap.cpp:66
bool m_initialized
Definition: environmentmap.h:54
~EnvironmentMap()
Definition: environmentmap.cpp:21
The ScreenAlignedQuad class encapsulates the drawing of a screen aligned quad.
Definition: screenalignedquad.h:10
void paint(const Camera &camera)
Paints environmentmap into the scene using a ScreenAlignedQuad.
Definition: environmentmap.cpp:28
EnvironmentMap(QOpenGLFunctions &gl, QString cubeMapPrefix, QObject *parent=0)
Creates a new EnvironmentMap. The specified cube map textures are loaded immediately.
Definition: environmentmap.cpp:10
QOpenGLFunctions & m_gl
Definition: environmentmap.h:55