consider hotspot of cursor for better loupe movement.

This commit is contained in:
hecomi
2019-01-07 22:32:24 +09:00
parent 0329eef501
commit 4ba7caf792
13 changed files with 172 additions and 98 deletions
@@ -464,4 +464,16 @@ int Cursor::GetPitch() const
int Cursor::GetType() const
{
return shapeInfo_.Type;
}
int Cursor::GetHotSpotX() const
{
return shapeInfo_.HotSpot.x;
}
int Cursor::GetHotSpotY() const
{
return shapeInfo_.HotSpot.y;
}
@@ -30,6 +30,8 @@ public:
int GetHeight() const;
int GetPitch() const;
int GetType() const;
int GetHotSpotX() const;
int GetHotSpotY() const;
private:
bool isVisible_ = false;
@@ -340,6 +340,18 @@ extern "C"
return g_manager->GetCursor()->GetType();
}
UNITY_INTERFACE_EXPORT int UNITY_INTERFACE_API GetCursorHotSpotX()
{
if (!g_manager) return -1;
return g_manager->GetCursor()->GetHotSpotX();
}
UNITY_INTERFACE_EXPORT int UNITY_INTERFACE_API GetCursorHotSpotY()
{
if (!g_manager) return -1;
return g_manager->GetCursor()->GetHotSpotY();
}
UNITY_INTERFACE_EXPORT void UNITY_INTERFACE_API GetCursorTexture(ID3D11Texture2D* texture)
{
if (!g_manager) return;