GameKit  0.0.1a
C++ gamedev tools
TilemapRenderer.hpp
Go to the documentation of this file.
1 /*
2  * =====================================================================================
3  *
4  * Filename: TilemapRenderer.hpp
5  *
6  * Description:
7  *
8  * Created: 15/02/2019 19:20:57
9  *
10  * Author: Quentin Bazin, <quent42340@gmail.com>
11  *
12  * =====================================================================================
13  */
14 #ifndef GK_TILEMAPRENDERER_HPP_
15 #define GK_TILEMAPRENDERER_HPP_
16 
17 #include "gk/gl/IDrawable.hpp"
18 #include "gk/gl/VertexBuffer.hpp"
19 #include "gk/graphics/Tileset.hpp"
20 
21 namespace gk {
22 
23 class Tilemap;
24 
26  public:
27  void init(Tilemap *map, u16 mapWidth, u16 mapHeight, u8 mapLayers);
28 
29  void updateTile(u8 layer, u16 tileX, u16 tileY, u16 id, Tilemap &map);
30 
31  private:
32  void draw(gk::RenderTarget &target, gk::RenderStates states) const override;
33 
35 
36  Tilemap *m_map = nullptr;
37 };
38 
39 } // namespace gk
40 
41 #endif // GK_TILEMAPRENDERER_HPP_
void updateTile(u8 layer, u16 tileX, u16 tileY, u16 id, Tilemap &map)
unsigned short u16
Definition: IntTypes.hpp:22
unsigned char u8
Definition: IntTypes.hpp:21
void draw(gk::RenderTarget &target, gk::RenderStates states) const override
Draw the object to a render target.
gk::VertexBuffer m_vbo
void init(Tilemap *map, u16 mapWidth, u16 mapHeight, u8 mapLayers)
Abstract base class for objects that can be drawn to a render target.
Definition: IDrawable.hpp:25