Added to ImGuiImplementation GetCursorData function allowing to access data associated with ImGui cursors (UVs and size).

This commit is contained in:
Sebastian 2018-04-21 21:40:05 +01:00
parent cfc76ea286
commit d152b4193c
2 changed files with 24 additions and 0 deletions

View File

@ -28,6 +28,8 @@
#endif // PLATFORM_WINDOWS #endif // PLATFORM_WINDOWS
#include "ImGuiInteroperability.h"
namespace ImGuiImplementation namespace ImGuiImplementation
{ {
// This is exposing ImGui default context for the whole module. // This is exposing ImGui default context for the whole module.
@ -41,4 +43,23 @@ namespace ImGuiImplementation
{ {
SaveIniSettingsToDisk(Filename); SaveIniSettingsToDisk(Filename);
} }
bool GetCursorData(int CursorType, FVector2D& OutSize, FVector2D& OutUVMin, FVector2D& OutUVMax, FVector2D& OutOutlineUVMin, FVector2D& OutOutlineUVMax)
{
if (static_cast<unsigned>(CursorType) < static_cast<unsigned>(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;
}
}
} }

View File

@ -13,4 +13,7 @@ namespace ImGuiImplementation
// Save current context settings. // Save current context settings.
void SaveCurrentContextIniSettings(const char* Filename); void SaveCurrentContextIniSettings(const char* Filename);
// Get specific cursor data.
bool GetCursorData(int CursorType, FVector2D& OutSize, FVector2D& OutUVMin, FVector2D& OutUVMax, FVector2D& OutOutlineUVMin, FVector2D& OutOutlineUVMax);
} }