diff --git a/Source/ImGui/Private/ImGuiImplementation.cpp b/Source/ImGui/Private/ImGuiImplementation.cpp index 7bac665..3aa791c 100644 --- a/Source/ImGui/Private/ImGuiImplementation.cpp +++ b/Source/ImGui/Private/ImGuiImplementation.cpp @@ -28,6 +28,8 @@ #endif // PLATFORM_WINDOWS +#include "ImGuiInteroperability.h" + namespace ImGuiImplementation { // This is exposing ImGui default context for the whole module. @@ -41,4 +43,23 @@ namespace ImGuiImplementation { SaveIniSettingsToDisk(Filename); } + + bool GetCursorData(int CursorType, FVector2D& OutSize, FVector2D& OutUVMin, FVector2D& OutUVMax, FVector2D& OutOutlineUVMin, FVector2D& OutOutlineUVMax) + { + if (static_cast(CursorType) < static_cast(ImGuiMouseCursor_Count_)) + { + using namespace ImGuiInterops; + ImGuiMouseCursorData& CursorData = GImGui->MouseCursorData[CursorType]; + OutSize = ToVector2D(CursorData.Size); + OutUVMin = ToVector2D(CursorData.TexUvMin[0]); + OutUVMax = ToVector2D(CursorData.TexUvMax[0]); + OutOutlineUVMin = ToVector2D(CursorData.TexUvMin[1]); + OutOutlineUVMax = ToVector2D(CursorData.TexUvMax[1]); + return true; + } + else + { + return false; + } + } } \ No newline at end of file diff --git a/Source/ImGui/Private/ImGuiImplementation.h b/Source/ImGui/Private/ImGuiImplementation.h index 31aa441..7cc5084 100644 --- a/Source/ImGui/Private/ImGuiImplementation.h +++ b/Source/ImGui/Private/ImGuiImplementation.h @@ -13,4 +13,7 @@ namespace ImGuiImplementation // Save current context settings. void SaveCurrentContextIniSettings(const char* Filename); + + // Get specific cursor data. + bool GetCursorData(int CursorType, FVector2D& OutSize, FVector2D& OutUVMin, FVector2D& OutUVMax, FVector2D& OutOutlineUVMin, FVector2D& OutOutlineUVMax); }