1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Add wrapper for ImGui mouse handling.

This commit is contained in:
Bartosz Taudul
2020-08-01 11:49:43 +02:00
parent 90e01a4888
commit 733b9c4048
4 changed files with 50 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
#include "TracyMouse.hpp"
namespace tracy
{
bool IsMouseDown( ImGuiMouseButton button )
{
return ImGui::IsMouseDown( button );
}
bool IsMouseClicked( ImGuiMouseButton button )
{
return ImGui::IsMouseClicked( button );
}
bool IsMouseDragging( ImGuiMouseButton button, float lock_threshold )
{
return ImGui::IsMouseDragging( button, lock_threshold );
}
ImVec2 GetMouseDragDelta( ImGuiMouseButton button, float lock_threshold )
{
return ImGui::GetMouseDragDelta( button, lock_threshold );
}
}
+16
View File
@@ -0,0 +1,16 @@
#ifndef __TRACYMOUSE_HPP__
#define __TRACYMOUSE_HPP__
#include "../imgui/imgui.h"
namespace tracy
{
bool IsMouseDown( ImGuiMouseButton button );
bool IsMouseClicked( ImGuiMouseButton button );
bool IsMouseDragging( ImGuiMouseButton button, float lock_threshold = -1.f );
ImVec2 GetMouseDragDelta( ImGuiMouseButton button, float lock_threshold = -1.f );
}
#endif