Update JGL.cpp
Some checks failed
Run ReCI Build Test / Explore-Gitea-Actions (push) Failing after 1m22s

Setting glLineWidth inside of glBegin causes error 1282.
This commit is contained in:
2024-07-07 19:59:10 -04:00
parent 0914b496e7
commit a8145cb926

View File

@@ -62,8 +62,8 @@ namespace JGL {
void J2D::OutlineRect(const Color3 &color, const Vector2 &pos, const Vector2 &size, float thickness) {
auto vp_pos = pos;
auto vp_size = size;
glBegin(GL_LINE_LOOP);
glLineWidth(thickness);
glBegin(GL_LINE_LOOP);
glColor3f(color.r, color.g, color.b);
glVertex2f(vp_pos.x, vp_pos.y);
glVertex2f(vp_pos.x, vp_pos.y + vp_size.y);
@@ -75,8 +75,8 @@ namespace JGL {
void J2D::DrawLine(const Color3 &color, const Vector2 &A, const Vector2 &B, float thickness) {
auto vp_a = A;
auto vp_b = B;
glBegin(GL_LINES);
glLineWidth(thickness);
glBegin(GL_LINES);
glColor3f(color.r, color.g, color.b);
glVertex2f(vp_a.x, vp_a.y);
glVertex2f(vp_b.x, vp_b.y);
@@ -161,8 +161,8 @@ namespace JGL {
glEnable(GL_DEPTH_TEST);
}
void J3D::DrawLine(const Color3 &color, const Vector3 &A, const Vector3 &B, float thickness) {
glBegin(GL_LINES);
glLineWidth(thickness);
glBegin(GL_LINES);
glColor3f(color.r / 255.f, color.g / 255.f, color.b / 255.f);
glVertex3f(A.x, A.y, A.z);
glVertex3f(B.x, B.y, B.z);