Add iOS platform (refactor Mac into shared Apple platform impl)

This commit is contained in:
Wojtek Figat
2023-03-15 20:57:44 +01:00
parent dc29ee180e
commit 0ba261d338
84 changed files with 2806 additions and 1623 deletions

View File

@@ -520,6 +520,16 @@ void PlatformBase::CreateGuid(Guid& result)
result = Guid(dateThingHigh, randomThing | (sequentialThing << 16), cyclesThing, dateThingLow);
}
Rectangle PlatformBase::GetMonitorBounds(const Float2& screenPos)
{
return Rectangle(Float2::Zero, Platform::GetDesktopSize());
}
Rectangle PlatformBase::GetVirtualDesktopBounds()
{
return Rectangle(Float2::Zero, Platform::GetDesktopSize());
}
Float2 PlatformBase::GetVirtualDesktopSize()
{
return Platform::GetVirtualDesktopBounds().Size;
@@ -616,6 +626,8 @@ const Char* ToString(PlatformType type)
return TEXT("PlayStation 5");
case PlatformType::Mac:
return TEXT("Mac");
case PlatformType::iOS:
return TEXT("iOS");
default:
return TEXT("");
}

View File

@@ -665,7 +665,7 @@ public:
/// </summary>
/// <param name="screenPos">The screen position (in pixels).</param>
/// <returns>The monitor bounds.</returns>
API_FUNCTION() static Rectangle GetMonitorBounds(const Float2& screenPos) = delete;
API_FUNCTION() static Rectangle GetMonitorBounds(const Float2& screenPos);
/// <summary>
/// Gets size of the primary desktop.
@@ -677,7 +677,7 @@ public:
/// Gets virtual bounds of the desktop made of all the monitors outputs attached.
/// </summary>
/// <returns>Whole desktop size.</returns>
API_PROPERTY() static Rectangle GetVirtualDesktopBounds() = delete;
API_PROPERTY() static Rectangle GetVirtualDesktopBounds();
/// <summary>
/// Gets virtual size of the desktop made of all the monitors outputs attached.