Transitioning text editor to SDL

This commit is contained in:
Krzosa Karol
2024-07-26 17:08:05 +02:00
parent def8b6bdc2
commit 27b322bf25
11 changed files with 67 additions and 695 deletions

View File

@@ -49,6 +49,7 @@ Vec2 GetSizeF(Rect2I r) {
Vec2 ToVec2(Vec2I v) { return {(float)v.x, (float)v.y}; }
Vec2I ToVec2I(Vec2 v) { return {(Int)v.x, (Int)v.y}; }
Rect2I ToRect2I(Rect2 r) { return {ToVec2I(r.min), ToVec2I(r.max)}; }
Rect2 ToRect2(Rect2I r) { return {ToVec2(r.min), ToVec2(r.max)}; }
// clang-format off
Rect2 operator-(Rect2 r, Rect2 value) { return { r.min.x - value.min.x, r.min.y - value.min.y, r.max.x - value.max.x, r.max.y - value.max.y }; }

View File

@@ -8,6 +8,13 @@ struct Rect2I {
Vec2I max;
};
struct Color {
uint8_t r;
uint8_t g;
uint8_t b;
uint8_t a;
};
Vec2I GetSize(Rect2I r) {
Vec2I result = {r.max.x - r.min.x, r.max.y - r.min.y};
return result;