summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-05 11:42:01 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-05 11:42:01 -0500
commitcefdff9a6a449506ddaeae56a2e038a1a2106846 (patch)
treee5753b372848e62528ed08b5c2d70d406914a16f /menu.c
parentf6fe651ed8bedb0308f75a7b15ef913add799848 (diff)
converted everything to modern opengl
for some reason SDL_GL_SwapWindow seems to be in a busy loop?
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/menu.c b/menu.c
index 70aaf9d..b9d3e66 100644
--- a/menu.c
+++ b/menu.c
@@ -167,10 +167,8 @@ static void menu_render(Ted *ted, Menu menu) {
float char_height_bold = text_font_char_height(font_bold);
// render backdrop
- glBegin(GL_QUADS);
- gl_color_rgba(colors[COLOR_MENU_BACKDROP]);
- rect_render(rect(V2(0, 0), V2(window_width, window_height)));
- glEnd();
+ gl_geometry_rect(rect(V2(0, 0), V2(window_width, window_height)), colors[COLOR_MENU_BACKDROP]);
+ gl_geometry_draw();
if (*ted->warn_overwrite) {
char const *path = ted->warn_overwrite;
@@ -196,12 +194,9 @@ static void menu_render(Ted *ted, Menu menu) {
rect_coords(rect, &menu_x1, &menu_y1, &menu_x2, &menu_y2);
// menu rectangle & border
- glBegin(GL_QUADS);
- gl_color_rgba(colors[COLOR_MENU_BG]);
- rect_render(rect);
- gl_color_rgba(colors[COLOR_BORDER]);
- rect_render_border(rect, settings->border_thickness);
- glEnd();
+ gl_geometry_rect(rect, colors[COLOR_MENU_BG]);
+ gl_geometry_rect_border(rect, settings->border_thickness, colors[COLOR_BORDER]);
+ gl_geometry_draw();
menu_x1 += padding;
menu_y1 += padding;