diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-09 05:01:04 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-09 05:01:04 +0200 |
| commit | e3b2c9267e7a8da5adca522a48a9f9a8457f89d8 (patch) | |
| tree | 1c875950e7c48e0533acdc85fff381d299b39353 /src/wireframe-quad.hpp | |
| parent | 1fa699d2969f10b383e20da7a1f32a90cb3ed70e (diff) | |
a
Diffstat (limited to 'src/wireframe-quad.hpp')
| -rw-r--r-- | src/wireframe-quad.hpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/wireframe-quad.hpp b/src/wireframe-quad.hpp new file mode 100644 index 00000000..062bf913 --- /dev/null +++ b/src/wireframe-quad.hpp @@ -0,0 +1,32 @@ +#pragma once + +#include <Magnum/Math/Vector2.h> +#include <Magnum/Math/Vector3.h> +#include <Magnum/GL/Mesh.h> + +namespace Magnum::Examples::wireframe { + +template<typename T> +struct wireframe_mesh; + +struct quad final +{ + quad(Vector3 center, Vector2 size); + + static constexpr std::size_t num_vertices = 4; + static constexpr GL::MeshPrimitive primitive = GL::MeshPrimitive::LineLoop; + + using vertex_array = std::array<Vector3, num_vertices>; + + vertex_array make_vertex_array() const; + void on_draw() const; + +private: + Vector3 center; + Vector2 size; + float line_width = 2; +}; + + + +} // namespace Magnum::Examples::wireframe |
