Branimir Karadžić 7 gadi atpakaļ
vecāks
revīzija
7325fcf11e
2 mainītis faili ar 10 papildinājumiem un 0 dzēšanām
  1. 9 0
      3rdparty/ocornut-imgui/imgui.cpp
  2. 1 0
      3rdparty/ocornut-imgui/imgui.h

+ 9 - 0
3rdparty/ocornut-imgui/imgui.cpp

@@ -4529,6 +4529,15 @@ bool ImGui::IsMouseDown(int button)
     return g.IO.MouseDown[button];
 }
 
+bool ImGui::IsAnyMouseDown()
+{
+    ImGuiContext& g = *GImGui;
+    for (int n = 0; n < IM_ARRAYSIZE(g.IO.MouseDown); n++)
+        if (g.IO.MouseDown[n])
+            return true;
+    return false;
+}
+
 bool ImGui::IsMouseClicked(int button, bool repeat)
 {
     ImGuiContext& g = *GImGui;

+ 1 - 0
3rdparty/ocornut-imgui/imgui.h

@@ -507,6 +507,7 @@ namespace ImGui
     IMGUI_API bool          IsKeyReleased(int user_key_index);                                  // was key released (went from Down to !Down)..
     IMGUI_API int           GetKeyPressedAmount(int key_index, float repeat_delay, float rate); // uses provided repeat rate/delay. return a count, most often 0 or 1 but might be >1 if RepeatRate is small enough that DeltaTime > RepeatRate
     IMGUI_API bool          IsMouseDown(int button);                                            // is mouse button held
+    IMGUI_API bool          IsAnyMouseDown();                                                   // is any mouse button held
     IMGUI_API bool          IsMouseClicked(int button, bool repeat = false);                    // did mouse button clicked (went from !Down to Down)
     IMGUI_API bool          IsMouseDoubleClicked(int button);                                   // did mouse button double-clicked. a double-click returns false in IsMouseClicked(). uses io.MouseDoubleClickTime.
     IMGUI_API bool          IsMouseReleased(int button);                                        // did mouse button released (went from Down to !Down)