xoreos  0.0.5
renderman.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef GRAPHICS_RENDER_RENDERMANAGER_H
26 #define GRAPHICS_RENDER_RENDERMANAGER_H
27 
28 #include "glm/vec3.hpp"
29 #include "glm/mat4x4.hpp"
30 
32 
33 #include "src/common/singleton.h"
34 
35 namespace Graphics {
36 
37 namespace Render {
38 
39 class RenderManager : public Common::Singleton<RenderManager> {
40 public:
41 
42  enum SortingHints {
43  SORT_HINT_NORMAL = 0, // Set normal render order sorting.
44  SORT_HINT_ALLDEPTH = 1 // Sort _everything_ by depth. Not optimal for rendering, but some games require it.
45  };
46 
47  RenderManager();
49 
50  void setSortingHint(SortingHints hint);
51 
52  void setCameraReference(const glm::vec3 &reference);
53 
54  void queueRenderable(Shader::ShaderRenderable *renderable, const glm::mat4 *transform, float alpha);
55 
56  void sort();
57 
58  void render();
59 
60  void clear();
61 
62  void init() {}
63  void deinit() {}
64  void cleanup() {}
65 
66 private:
73 
75 
76  //std::vector<GLContainer *> _queueColorImmediate; // For anything special outside the normal render path.
77 };
78 
79 } // namespace Render
80 
81 } // namespace Graphics
82 
84 #define RenderMan Graphics::Render::RenderManager::instance()
85 
86 #endif // GRAPHICS_RENDER_RENDERMANAGER_H
Class and macro for implementing singletons.
void setSortingHint(SortingHints hint)
Definition: renderman.cpp:41
void setCameraReference(const glm::vec3 &reference)
Definition: renderman.cpp:45
Generic template base class for implementing the singleton design pattern.
Definition: singleton.h:61
RenderQueue _queueColorTransparentPrimary
Definition: renderman.h:70
Render queue, for efficient OpenGL render calls.
RenderQueue _queueColorSolidPrimary
Definition: renderman.h:67
RenderQueue _queueColorTransparentSecondary
Definition: renderman.h:71
void queueRenderable(Shader::ShaderRenderable *renderable, const glm::mat4 *transform, float alpha)
Definition: renderman.cpp:53
RenderQueue _queueColorSolidSecondary
Definition: renderman.h:68