Add GetMonitorPosition
This commit is contained in:
parent
aa66089ef3
commit
dafe42c497
|
|
@ -647,10 +647,22 @@ int GetCurrentMonitor(void)
|
||||||
// Get selected monitor position
|
// Get selected monitor position
|
||||||
Vector2 GetMonitorPosition(int monitor)
|
Vector2 GetMonitorPosition(int monitor)
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "GetMonitorPosition() not implemented on target platform");
|
if (monitor < 0 || monitor >= SDL_GetNumVideoDisplays())
|
||||||
|
{
|
||||||
|
TRACELOG(LOG_ERROR, "Invalid monitor index");
|
||||||
return (Vector2) { 0, 0 };
|
return (Vector2) { 0, 0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SDL_Rect displayBounds;
|
||||||
|
if (SDL_GetDisplayBounds(monitor, &displayBounds) != 0)
|
||||||
|
{
|
||||||
|
TRACELOG(LOG_ERROR, "Failed to get display bounds");
|
||||||
|
return (Vector2) { 0, 0 };
|
||||||
|
}
|
||||||
|
|
||||||
|
return (Vector2) { displayBounds.x, displayBounds.y };
|
||||||
|
}
|
||||||
|
|
||||||
// Get selected monitor width (currently used by monitor)
|
// Get selected monitor width (currently used by monitor)
|
||||||
int GetMonitorWidth(int monitor)
|
int GetMonitorWidth(int monitor)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user