diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-05 11:42:01 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-05 11:42:01 -0500 |
commit | cefdff9a6a449506ddaeae56a2e038a1a2106846 (patch) | |
tree | e5753b372848e62528ed08b5c2d70d406914a16f /gl.c | |
parent | f6fe651ed8bedb0308f75a7b15ef913add799848 (diff) |
converted everything to modern opengl
for some reason SDL_GL_SwapWindow seems to be in a busy loop?
Diffstat (limited to 'gl.c')
-rw-r--r-- | gl.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -194,6 +194,16 @@ static void gl_geometry_rect(Rect r, u32 color_rgba) { arr_add(gl_geometry_triangles, triangle); } +static void gl_geometry_rect_border(Rect r, float border_thickness, u32 color) { + float border_radius = border_thickness * 0.5f; + float x1 = r.pos.x, y1 = r.pos.y, x2 = x1 + r.size.x, y2 = y1 + r.size.y; + + gl_geometry_rect(rect4(x1+border_radius, y1-border_radius, x2+border_radius, y1+border_radius), color); + gl_geometry_rect(rect4(x1-border_radius, y2-border_radius, x2-border_radius, y2+border_radius), color); + gl_geometry_rect(rect4(x1-border_radius, y1-border_radius, x1+border_radius, y2-border_radius), color); + gl_geometry_rect(rect4(x2-border_radius, y1+border_radius, x2+border_radius, y2+border_radius), color); +} + static void gl_geometry_draw(void) { size_t ntriangles = arr_len(gl_geometry_triangles); |