diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-02 21:47:13 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-02 21:47:13 +0200 |
| commit | c8aa44e6b9543f5d90a02bc878d88ea07a747d78 (patch) | |
| tree | bbf4b367e89d005fc97d01ba5348b7cd8493def7 /wall-mesh.hpp | |
| parent | fb9ee17767d7d1e06f3cfa3b8cbc3956d081c118 (diff) | |
a
Diffstat (limited to 'wall-mesh.hpp')
| -rw-r--r-- | wall-mesh.hpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/wall-mesh.hpp b/wall-mesh.hpp index 905e7acc..02fafc27 100644 --- a/wall-mesh.hpp +++ b/wall-mesh.hpp @@ -36,12 +36,15 @@ private: using quad = std::array<vertex, 4>; using index_type = std::array<UnsignedShort, 6>; using vertex_array = std::array<quad, COUNT>; + using texture_array = std::array<GL::Texture2D*, COUNT>; - static void add_tile(vertex_array& data, std::size_t& pos, tile& x, local_coords pt); - static void add_wall(vertex_array& data, std::size_t& pos, tile_image& img, const position_array& positions); + static void maybe_add_tile(vertex_array& data, texture_array& textures, std::size_t& pos, + tile& x, local_coords pt); + static void add_wall(vertex_array& data, texture_array& textures, std::size_t& pos, + tile_image& img, const position_array& positions); GL::Mesh _mesh; - GL::Buffer _vertex_buffer{{}, Magnum::GL::BufferUsage::DynamicDraw}, + GL::Buffer _vertex_buffer{vertex_array{}, Magnum::GL::BufferUsage::StaticDraw}, _index_buffer{_index_data, Magnum::GL::BufferUsage::StaticDraw}; static const std::array<index_type, COUNT> _index_data; |
