From 19f8303d99c58f52a087d6f1b02ef0106ab1752e Mon Sep 17 00:00:00 2001 From: Jaby Blubb Date: Tue, 3 Oct 2023 20:44:08 +0200 Subject: [PATCH] Add LINE to make functions as last primitive --- .../src/Overlay/GPUTests/gpu_tests.cpp | 8 ++++---- include/PSX/GPU/gpu_primitives.hpp | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/examples/PoolBox/application/src/Overlay/GPUTests/gpu_tests.cpp b/examples/PoolBox/application/src/Overlay/GPUTests/gpu_tests.cpp index ca846b6e..ad5f19a2 100644 --- a/examples/PoolBox/application/src/Overlay/GPUTests/gpu_tests.cpp +++ b/examples/PoolBox/application/src/Overlay/GPUTests/gpu_tests.cpp @@ -88,21 +88,21 @@ static constexpr const auto rectangle5 = Make::POLY_GT4(Make::AreaI16( GPU::Color24::White()} ).set_semi_transparent(true); -static constexpr const auto line1 = GPU::LINE_F::create(LineColor, +static constexpr const auto line1 = Make::LINE_F(LineColor, Make::Vertex(0, 0), Make::Vertex(GPU::Display::Width, GPU::Display::Height) ); -static constexpr const auto line2 = GPU::LINE_F::create(LineColor.invert(), +static constexpr const auto line2 = Make::LINE_F(LineColor.invert(), Make::Vertex(0, 0), Make::Vertex(16, 0), Make::Vertex(16, 16), Make::Vertex(0, 0) ); -static constexpr const auto line3 = GPU::LINE_G::create( +static constexpr const auto line3 = Make::LINE_G( GPU::ColorVertex{LineColor, Make::Vertex(GPU::Display::Width, 0)}, GPU::ColorVertex{LineColor.invert(), Make::Vertex(0, GPU::Display::Height)} ); -static constexpr const auto line4 = GPU::LINE_G::create( +static constexpr const auto line4 = Make::LINE_G( GPU::ColorVertex{GPU::Color24::Red(), Make::Vertex(0, 0)}, GPU::ColorVertex{GPU::Color24::Green(), Make::Vertex(0, 16)}, GPU::ColorVertex{GPU::Color24::Blue(), Make::Vertex(16, 16)}, diff --git a/include/PSX/GPU/gpu_primitives.hpp b/include/PSX/GPU/gpu_primitives.hpp index c079715b..685d821a 100644 --- a/include/PSX/GPU/gpu_primitives.hpp +++ b/include/PSX/GPU/gpu_primitives.hpp @@ -149,6 +149,25 @@ namespace JabyEngine { } // ################################################################### + + static constexpr GPU::internal::SingleLine LINE_F(const GPU::Color24& color, const GPU::Vertex& start_point, const GPU::Vertex& end_point) { + return GPU::LINE_F::create(color, start_point, end_point); + } + + template + static constexpr GPU::internal::MultiLine LINE_F(const GPU::Color24& color, const GPU::Vertex& start_point, const ARGS&...rest) { + return GPU::LINE_F::create(color, start_point, rest...); + } + + static constexpr GPU::internal::SingleLine LINE_G(const GPU::ColorVertex& start_point, const GPU::ColorVertex& end_point) { + return GPU::LINE_G::create(start_point, end_point); + } + + template + static constexpr GPU::internal::MultiLine LINE_G(const GPU::ColorVertex& start_point, const ARGS&...rest) { + return GPU::LINE_G::create(start_point, rest...); + } + // ################################################################### // ################################################################### // ###################################################################