summaryrefslogtreecommitdiff
path: root/src/render.c
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik.ramaekers@protonmail.com>2020-03-19 11:07:11 +0100
committerAldrik Ramaekers <aldrik.ramaekers@protonmail.com>2020-03-19 11:07:11 +0100
commitdb0e36f6cb1206fc4be3af68858e03b8579b397f (patch)
tree56768288cc13ff89190d4a8954686857051c95a4 /src/render.c
parentf55a69f8cc9f8ede29183494c0b36a41c914f737 (diff)
tooltip
Diffstat (limited to 'src/render.c')
-rw-r--r--src/render.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/render.c b/src/render.c
index 3a681d9..6eafa7b 100644
--- a/src/render.c
+++ b/src/render.c
@@ -496,13 +496,24 @@ s32 calculate_text_width(font *font, char *text)
return x;
}
-void render_triangle(s32 x, s32 y, s32 w, s32 h, color tint)
+void render_triangle(s32 x, s32 y, s32 w, s32 h, color tint, triangle_direction dir)
{
glBegin(GL_TRIANGLES);
glColor4f(tint.r/255.0f, tint.g/255.0f, tint.b/255.0f, tint.a/255.0f);
- glVertex3i(x+(w/2), y+h, render_depth);
- glVertex3i(x, y, render_depth);
- glVertex3i(x+w, y, render_depth);
+
+ if (dir == TRIANGLE_DOWN)
+ {
+ glVertex3i(x+(w/2), y+h, render_depth);
+ glVertex3i(x, y, render_depth);
+ glVertex3i(x+w, y, render_depth);
+ }
+ else if (dir == TRIANGLE_UP)
+ {
+ glVertex3i(x+(w/2), y, render_depth);
+ glVertex3i(x+w, y+h, render_depth);
+ glVertex3i(x, y+h, render_depth);
+ }
+
glEnd();
}