Improve command window

This commit is contained in:
Krzosa Karol
2024-08-02 12:49:03 +02:00
parent 95dc31be91
commit 48dc808dcb
8 changed files with 80 additions and 40 deletions

View File

@@ -299,15 +299,19 @@ void DrawRect(Rect2I rect, Color color) {
PushQuad2D(RenderArena, &Vertices, ToRect2(rect), MainFont.white_texture_bounding_box, color);
}
void DrawRectOutline(Rect2 rect, Color color, float thickness = 2) {
Rect2 a = CutLeft(&rect, thickness);
Rect2 b = CutRight(&rect, thickness);
Rect2 c = CutTop(&rect, thickness);
Rect2 d = CutBottom(&rect, thickness);
PushQuad2D(RenderArena, &Vertices, a, MainFont.white_texture_bounding_box, color);
PushQuad2D(RenderArena, &Vertices, b, MainFont.white_texture_bounding_box, color);
PushQuad2D(RenderArena, &Vertices, c, MainFont.white_texture_bounding_box, color);
PushQuad2D(RenderArena, &Vertices, d, MainFont.white_texture_bounding_box, color);
}
void DrawRectOutline(Rect2I rect, Color color, Int thickness = 2) {
Rect2I a = CutLeft(&rect, thickness);
Rect2I b = CutRight(&rect, thickness);
Rect2I c = CutTop(&rect, thickness);
Rect2I d = CutBottom(&rect, thickness);
PushQuad2D(RenderArena, &Vertices, ToRect2(a), MainFont.white_texture_bounding_box, color);
PushQuad2D(RenderArena, &Vertices, ToRect2(b), MainFont.white_texture_bounding_box, color);
PushQuad2D(RenderArena, &Vertices, ToRect2(c), MainFont.white_texture_bounding_box, color);
PushQuad2D(RenderArena, &Vertices, ToRect2(d), MainFont.white_texture_bounding_box, color);
DrawRectOutline(ToRect2(rect), color, (float)thickness);
}
Int GetCharSpacing(Font *font, int codepoint = '_') {