hx3d  1
2D/3D Simple Game Framework
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
ordered_batch.hpp
1 /*
2  Ordered Batch.
3  Copyright (C) 2015 Denis BOURGE
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
18  USA
19 */
20 
21 #ifndef HX3D_GRAPHICS_ORDEREDBATCH
22 #define HX3D_GRAPHICS_ORDEREDBATCH
23 
24 #include "hx3d/graphics/base_batch.hpp"
25 
26 namespace hx3d {
27 
28 namespace graphics {
29 
30 class Shader;
31 class Camera;
32 
36 class OrderedBatch: public BaseBatch {
37 
38 public:
39  OrderedBatch();
40 
41  virtual void begin() override;
42  virtual void end() override;
43  virtual void draw(Mesh& mesh) override;
44  virtual void draw(gui::Text& text) override;
45  virtual void draw(gui::Text& text, math::Function function) override;
46 
47 private:
49  std::vector<std::pair<glm::mat4, Mesh*>> _meshes;
51  std::vector<gui::Text> _texts;
53  std::vector<std::pair<gui::Text, math::Function>> _funcTexts;
54 };
55 
56 } /* graphics */
57 } /* hx3d */
58 
59 #endif
virtual void end() override
End the batching.
Text GUI element.
Definition: text.hpp:37
hx3d framework namespace
Definition: audio.hpp:26
virtual void draw(Mesh &mesh) override
Draw the mesh.
virtual void begin() override
Begin the batching.
Displayable 2D/3D element.
Definition: mesh.hpp:41
Math function definition.
Definition: function.hpp:33
Draw ordered meshes and texts on screen.
Draw meshes and texts on screen.
Definition: base_batch.hpp:41