Currently Fucked

This commit is contained in:
2024-02-16 13:58:51 -05:00
parent 7a7e73a829
commit f676ef5332
4 changed files with 29 additions and 8 deletions

View File

@@ -118,8 +118,8 @@ namespace JGL
namespace J2D
{
void FillRect2D(const Color3 &color, const Vector2 &pos, const Vector2 &size) {
auto vp_pos = ScreenToViewport(pos);
auto vp_size = ScreenToViewport(size);
auto vp_pos = pos;//ScreenToViewport(pos);
auto vp_size = size;//ScreenToViewport(size);
glBegin(GL_QUADS);
glColor3f(color.r/255.f, color.g/255.f, color.b/255.f);
glVertex2f(vp_pos.x, vp_pos.y);
@@ -130,8 +130,8 @@ namespace JGL
}
void OutlineRect2D(const Color3 &color, const Vector2 &pos, const Vector2 &size, float thickness) {
auto vp_pos = ScreenToViewport(pos);
auto vp_size = ScreenToViewport(size);
auto vp_pos = pos;//ScreenToViewport(pos);
auto vp_size = size;//ScreenToViewport(size);
glBegin(GL_LINE_LOOP);
glLineWidth(thickness);
glColor3f(color.r, color.g, color.b);
@@ -203,6 +203,16 @@ namespace JGL
}
glEnd();
}
void FillTriangle2D(const Color3& color, const Triangle2D& tri)
{
glBegin(GL_LINE_LOOP);
glColor3f(color.r/255.f, color.g/255.f, color.b/255.f);
glVertex2f(tri.A.x, tri.A.y);
glVertex2f(tri.B.x, tri.B.y);
glVertex2f(tri.C.x, tri.C.y);
glEnd();
}
}