summaryrefslogtreecommitdiff
path: root/ui.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-05 10:12:55 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-05 10:12:55 -0500
commitdd3887ec47137b6bf993674356a73b3266bb8a51 (patch)
treec9981783a6574b58dd9f503384b2fe651495b224 /ui.c
parent1e7e392b9d5e593aeb9680d82b76afddad8ce2e6 (diff)
got text working with modern OpenGL
Diffstat (limited to 'ui.c')
-rw-r--r--ui.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/ui.c b/ui.c
index 310f725..1516b8f 100644
--- a/ui.c
+++ b/ui.c
@@ -423,8 +423,7 @@ static void file_selector_render(Ted *ted, FileSelector *fs) {
rect_coords(bounds, &x1, &y1, &x2, &y2);
// current working directory
- gl_color_rgba(colors[COLOR_TEXT]);
- text_render(font, fs->cwd, x1, y1);
+ text_render(font, fs->cwd, x1, y1, colors[COLOR_TEXT]);
y1 += char_height + padding;
// search buffer
@@ -485,9 +484,8 @@ static void button_render(Ted *ted, Rect button, char const *text, u32 color) {
rect_render_border(button, 1);
glEnd();
- gl_color_rgba(color);
v2 pos = rect_center(button);
- text_render_anchored(ted->font, text, pos.x, pos.y, ANCHOR_MIDDLE);
+ text_render_anchored(ted->font, text, pos.x, pos.y, color, ANCHOR_MIDDLE);
}
// returns true if the button was clicked on.
@@ -558,8 +556,7 @@ static void popup_render(Ted *ted, char const *title, char const *body) {
v2 title_size = {0};
text_get_size(font_bold, title, &title_size.x, &title_size.y);
v2 title_pos = v2_sub(V2(window_width * 0.5f, y), V2(title_size.x * 0.5f, 0));
- gl_color_rgba(colors[COLOR_TEXT]);
- text_render(font_bold, title, title_pos.x, title_pos.y);
+ text_render(font_bold, title, title_pos.x, title_pos.y, colors[COLOR_TEXT]);
y += char_height_bold;
// line separating text from body