hx3d  1
2D/3D Simple Game Framework
base_batch.cpp
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 #include "hx3d/graphics/base_batch.hpp"
22 
23 #include "hx3d/graphics/cameras/camera.hpp"
24 
25 #include "hx3d/core/core.hpp"
26 #include "hx3d/graphics/shader.hpp"
27 
28 #include "hx3d/utils/assets.hpp"
29 
30 namespace hx3d {
31 namespace graphics {
32 
33 BaseBatch::BaseBatch():
34  _camera(nullptr),
35  _shader(Core::Assets()->get<Shader>("base"))
36  {}
37 
38 void BaseBatch::setShader(const Ptr<Shader>& shader) {
39  _shader = shader;
40 }
41 
43  return _shader;
44 }
45 
47  _camera = &camera;
48 }
49 
51  return _camera;
52 }
53 
54 } /* graphics */
55 } /* hx3d */
2D/3D camera.
Definition: camera.hpp:41
Camera * getCamera()
Get the camera.
Definition: base_batch.cpp:50
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
Ptr< Shader > getShader()
Get the current batching shader.
Definition: base_batch.cpp:42
void setCamera(Camera &camera)
Set the camera for the next batching.
Definition: base_batch.cpp:46
std::shared_ptr< T > Ptr
Quick-typing shared ptr.
Definition: ptr.hpp:34