#pragma once #include "tile.hpp" #include "tile-atlas.hpp" #include #include #include #include #include #include namespace Magnum::Examples { struct tile_shader; struct chunk; struct floor_mesh final { floor_mesh(); floor_mesh(floor_mesh&&) = delete; floor_mesh(const floor_mesh&) = delete; void draw(tile_shader& shader, chunk& c); private: static constexpr auto quad_index_count = 6; struct vertex_data final { Vector2 texcoords; }; using quad_data = std::array; using quad_positions_data = std::array; using index_type = std::array; static void set_tile(quad_data& data, tile& x); static const std::array _index_data; static const std::array _position_data; GL::Mesh _mesh; GL::Buffer _vertex_buffer{{}, Magnum::GL::BufferUsage::DynamicDraw}, _index_buffer{_index_data, Magnum::GL::BufferUsage::StaticDraw}, _positions_buffer{_position_data, Magnum::GL::BufferUsage::StaticDraw}; }; } // namespace Magnum::Examples