From 3a3133aa1ddba3410667863d38cc3c5baf64e562 Mon Sep 17 00:00:00 2001 From: Kolja Lubitz Date: Fri, 8 Nov 2024 17:38:03 +0100 Subject: [PATCH] Add drawLine(Mat3 modelview, Vec2 start, Vec2 end) overload --- src/jngl/shapes.hpp | 3 +++ src/main.cpp | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/jngl/shapes.hpp b/src/jngl/shapes.hpp index cd6521d9..21a0c9aa 100644 --- a/src/jngl/shapes.hpp +++ b/src/jngl/shapes.hpp @@ -53,6 +53,9 @@ void drawLine(Vec2 start, Vec2 end); /// \deprecated Use drawLine(Vec2, Vec2) instead void drawLine(double xstart, double ystart, double xend, double yend); +/// Draws a line from \a start to \a end +void drawLine(Mat3 modelview, Vec2 start, Vec2 end); + /// Draws a line from (0, 0) to \a end void drawLine(const Mat3& modelview, Vec2 end); diff --git a/src/main.cpp b/src/main.cpp index 67ff2f49..43cab4e0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -599,6 +599,10 @@ void drawLine(const Vec2 start, const Vec2 end) { pWindow->drawLine(jngl::modelview().translate(start), end - start); } +void drawLine(Mat3 modelview, const Vec2 start, const Vec2 end) { + pWindow->drawLine(modelview.translate(start), end - start); +} + void drawLine(const Mat3& modelview, const Vec2 end) { pWindow->drawLine(modelview, end); }