diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-09 16:17:23 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-09 16:17:23 +0100 |
commit | 1febb02d958fa4cf8c15e3ca18f9d644f9fc80fb (patch) | |
tree | d9b389f6c2ff8e031bd70d503c289bcfddf2f048 /draw/anim.hpp | |
parent | 09605450ecc99ad1f4d50e9c143fda6c7762e702 (diff) |
depth buffer works!
Diffstat (limited to 'draw/anim.hpp')
-rw-r--r-- | draw/anim.hpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/draw/anim.hpp b/draw/anim.hpp index 04fd92c8..163c5b1a 100644 --- a/draw/anim.hpp +++ b/draw/anim.hpp @@ -24,14 +24,18 @@ struct anim_mesh final void draw(tile_shader& shader, const anim_atlas& atlas, rotation r, std::size_t frame, local_coords xy); private: - struct vertex_data final { Vector2 texcoords; }; + struct vertex_data final { + Vector3 position; + Vector2 texcoords; + float depth = -1; + }; using quad_data = std::array<vertex_data, 4>; static std::array<UnsignedShort, 6> make_index_array(); GL::Mesh _mesh; GL::Buffer _vertex_buffer{quad_data{}, Magnum::GL::BufferUsage::DynamicDraw}, - _index_buffer{make_index_array()}, _positions_buffer{std::array<Vector3, 4>{}}; + _index_buffer{make_index_array()}; }; } // namespace floormat |