twn_draw.c: draw_box()
This commit is contained in:
@ -526,3 +526,14 @@ void draw_line(Vec2 start,
|
||||
|
||||
arrput(ctx.render_queue_2d, primitive);
|
||||
}
|
||||
|
||||
|
||||
void draw_box(Rect rect,
|
||||
float thickness,
|
||||
Color color)
|
||||
{
|
||||
draw_line((Vec2){rect.x, rect.y}, (Vec2){rect.x + rect.w, rect.y}, thickness, color);
|
||||
draw_line((Vec2){rect.x + rect.w, rect.y}, (Vec2){rect.x + rect.w, rect.y + rect.h}, thickness, color);
|
||||
draw_line((Vec2){rect.x + rect.w, rect.y + rect.h}, (Vec2){rect.x, rect.y + rect.h}, thickness, color);
|
||||
draw_line((Vec2){rect.x, rect.y + rect.h}, (Vec2){rect.x, rect.y}, thickness, color);
|
||||
}
|
||||
|
Reference in New Issue
Block a user