hx3d  1
2D/3D Simple Game Framework
base_batch.hpp
1 /*
2  Base Batch Class.
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_BASEBATCH
22 #define HX3D_GRAPHICS_BASEBATCH
23 
24 #include "hx3d/graphics/mesh.hpp"
25 #include "hx3d/gui/text.hpp"
26 #include "hx3d/utils/ptr.hpp"
27 
28 namespace hx3d {
29 
33 namespace graphics {
34 
35 class Shader;
36 class Camera;
37 
41 class BaseBatch {
42 
43 public:
44  BaseBatch();
45 
49  virtual void begin() = 0;
50 
54  virtual void end() = 0;
55 
63  virtual void draw(Mesh& mesh) = 0;
64 
72  virtual void draw(gui::Text& text) = 0;
73 
82  virtual void draw(gui::Text& text, math::Function function) = 0;
83 
85 
91  void setShader(const Ptr<Shader>& shader);
92 
99 
105  void setCamera(Camera& camera);
106 
112  Camera* getCamera();
113 
114 protected:
119 };
120 
121 } /* graphics */
122 } /* hx3d */
123 
124 #endif
virtual void begin()=0
Begin the batching.
2D/3D camera.
Definition: camera.hpp:41
Ptr< Shader > _shader
Shader.
Definition: base_batch.hpp:118
virtual void draw(Mesh &mesh)=0
Draw the mesh.
Camera * getCamera()
Get the camera.
Definition: base_batch.cpp:50
Text GUI element.
Definition: text.hpp:37
hx3d framework namespace
Definition: audio.hpp:26
void setShader(const Ptr< Shader > &shader)
Set the shader for the next batching.
Definition: base_batch.cpp:38
virtual void end()=0
End the batching.
Ptr< Shader > getShader()
Get the current batching shader.
Definition: base_batch.cpp:42
Displayable 2D/3D element.
Definition: mesh.hpp:41
Math function definition.
Definition: function.hpp:33
Camera * _camera
Camera.
Definition: base_batch.hpp:116
void setCamera(Camera &camera)
Set the camera for the next batching.
Definition: base_batch.cpp:46
Draw meshes and texts on screen.
Definition: base_batch.hpp:41
std::shared_ptr< T > Ptr
Quick-typing shared ptr.
Definition: ptr.hpp:34