summaryrefslogtreecommitdiff
path: root/imgui_ops.h
diff options
context:
space:
mode:
authorFox Caminiti <fox@foxcam.net>2022-07-22 20:45:08 -0400
committerFox Caminiti <fox@foxcam.net>2022-07-22 20:45:08 -0400
commitfc8040d695644aaca4596adebeca4ea1369ef630 (patch)
treeaea6979da97c43df8f03f3a2d7b421ee71bef370 /imgui_ops.h
first
Diffstat (limited to 'imgui_ops.h')
-rw-r--r--imgui_ops.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/imgui_ops.h b/imgui_ops.h
new file mode 100644
index 0000000..629815f
--- /dev/null
+++ b/imgui_ops.h
@@ -0,0 +1,74 @@
+ImVec2 operator+(ImVec2 A, ImVec2 B)
+{
+ ImVec2 Result;
+
+ Result.x = A.x + B.x;
+ Result.y = A.y + B.y;
+
+ return Result;
+}
+
+ImVec2 operator+(ImVec2 A, int B)
+{
+ ImVec2 Result;
+
+ Result.x = A.x + B;
+ Result.y = A.y + B;
+
+ return Result;
+}
+
+ImVec2 operator-(ImVec2 A, ImVec2 B)
+{
+ ImVec2 Result;
+
+ Result.x = A.x - B.x;
+ Result.y = A.y - B.y;
+
+ return Result;
+}
+
+ImVec2 operator*(ImVec2 A, real32 B)
+{
+ ImVec2 Result;
+
+ Result.x = A.x * B;
+ Result.y = A.y * B;
+
+ return Result;
+}
+
+ImVec2 operator*(ImVec2 A, ImVec2 B)
+{
+ ImVec2 Result;
+
+ Result.x = A.x * B.x;
+ Result.y = A.y * B.y;
+
+ return Result;
+}
+
+ImVec2 operator/(ImVec2 A, ImVec2 B)
+{
+ ImVec2 Result;
+
+ Result.x = A.x / B.x;
+ Result.y = A.y / B.y;
+
+ return Result;
+}
+
+inline bool32
+IsRectTouching(ImVec2 Min1, ImVec2 Max1, ImVec2 Min2, ImVec2 Max2)
+{
+ bool32 Result = 0;
+ if ((Max1.x > Min2.x && Min1.x < Min2.x) &&
+ (Max1.y > Min2.y && Min1.y < Min2.y))
+ Result = 1;
+ // if (
+ // Result = 1;
+ // if (Min1.x > Min2.x)
+
+ return(Result);
+}
+