Skip to content

Commit

Permalink
Add drawLine(Mat3 modelview, Vec2 start, Vec2 end) overload
Browse files Browse the repository at this point in the history
  • Loading branch information
pinguin999 committed Nov 8, 2024
1 parent f99aa3e commit 3a3133a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/jngl/shapes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 4 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 3a3133a

Please sign in to comment.