Terminus
skybox.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 
6 
7 class QImage;
8 class QOpenGLFunctions;
9 
10 namespace terminus
11 {
12 
13 class ScreenAlignedQuad;
14 
20 {
21 public:
22  SkyBox(World & world);
23 
24  void localRenderSetup(QOpenGLFunctions & gl, Program & program) const override;
25  void localRenderCleanup(QOpenGLFunctions & gl, Program & program) const override;
26 protected:
27  void allocateCubeMap(QOpenGLFunctions & gl) const;
28  void deallocateCubeMap(QOpenGLFunctions & gl) const;
29 
30  mutable bool m_cubeMapOnGPU;
31  std::unique_ptr<QImage> m_imageNX;
32  std::unique_ptr<QImage> m_imagePX;
33  std::unique_ptr<QImage> m_imageNY;
34  std::unique_ptr<QImage> m_imagePY;
35  std::unique_ptr<QImage> m_imageNZ;
36  std::unique_ptr<QImage> m_imagePZ;
37  mutable GLuint m_cubeMap;
38 };
39 
40 }
std::unique_ptr< QImage > m_imageNZ
Definition: skybox.h:35
void localRenderCleanup(QOpenGLFunctions &gl, Program &program) const override
override this method to customize the rendering process
Definition: skybox.cpp:35
void allocateCubeMap(QOpenGLFunctions &gl) const
Definition: skybox.cpp:40
std::unique_ptr< QImage > m_imagePY
Definition: skybox.h:34
GLuint m_cubeMap
Definition: skybox.h:37
std::unique_ptr< QImage > m_imageNX
Definition: skybox.h:31
SkyBox(World &world)
Definition: skybox.cpp:12
std::unique_ptr< QImage > m_imageNY
Definition: skybox.h:33
The AbstractGraphicsObject class is the root of a class hierarchy of objects that contain independen ...
Definition: abstractgraphicsobject.h:27
The SkyBox class renders an environment map in the form of a cube map on a screen aligned quad in the...
Definition: skybox.h:19
bool m_cubeMapOnGPU
Definition: skybox.h:30
std::unique_ptr< QImage > m_imagePZ
Definition: skybox.h:36
The program class implements the basic functionality used for binding programs to openGL...
Definition: program.h:18
std::unique_ptr< QImage > m_imagePX
Definition: skybox.h:32
The World class represents a running game instance and contains all graphical (3D) elements of the sc...
Definition: world.h:46
void localRenderSetup(QOpenGLFunctions &gl, Program &program) const override
override this method to customize the rendering process
Definition: skybox.cpp:27
Definition: eventhandler.cpp:18
void deallocateCubeMap(QOpenGLFunctions &gl) const
Definition: skybox.cpp:67