Stop using WindowSize and actually make use of event window size, provide default

This commit is contained in:
Krzosa Karol
2024-08-15 15:09:14 +02:00
parent d0bc7bdc4a
commit bafe0af407
6 changed files with 39 additions and 30 deletions

View File

@@ -110,6 +110,11 @@ Vec2 operator/=(Vec2 &a, float b) { a = a / b; return a; }
// clang-format on
Rect2 Rect0Size(float x, float y) {
Rect2 rect = {0, 0, x, y};
return rect;
}
Rect2 Rect2FromSize(Vec2 pos, Vec2 size) {
Rect2 result = {};
result.min = pos;

View File

@@ -73,6 +73,11 @@ Vec2I operator/=(Vec2I &a, Int b) { a = a / b; return a; }
// clang-format on
Rect2I RectI0Size(Int x, Int y) {
Rect2I rect = {0, 0, x, y};
return rect;
}
Rect2I Rect2IFromSize(Vec2I pos, Vec2I size) {
Rect2I result = {};
result.min = pos;