From c61e09ce986fa99debea040a7c0ac42749ad8052 Mon Sep 17 00:00:00 2001 From: Mel Date: Tue, 6 Feb 2024 02:09:17 +0100 Subject: Render outlines on currently targeted blocks --- src/GFX/Util/Primitives.hpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/GFX/Util/Primitives.hpp') diff --git a/src/GFX/Util/Primitives.hpp b/src/GFX/Util/Primitives.hpp index a267130..6654da6 100644 --- a/src/GFX/Util/Primitives.hpp +++ b/src/GFX/Util/Primitives.hpp @@ -31,17 +31,25 @@ private: Value m_set; }; -template -struct Primitive { +// A base primitive, could represent lines, triangles, quads primitives, etc. +template +struct BasePrimitive { std::array, N> positions; std::array, N> normals; - std::array indices; + std::array indices; }; +// Primitive made out of triangles (GL_TRIANGLES) +template +using Primitive = BasePrimitive; + using PlanePrimitive = Primitive<4>; PlanePrimitive plane(AABB aabb, FaceSet face); using BoxPrimitive = Primitive<4 * 6>; BoxPrimitive box(AABB aabb, FaceSet faces = FaceSet::all()); +using LineBoxPrimitive = BasePrimitive<4 * 2, 4 * 6>; +LineBoxPrimitive line_box(AABB aabb); + } -- cgit 1.4.1