summaryrefslogtreecommitdiffhomepage
path: root/src/rcore.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rcore.c')
-rw-r--r--src/rcore.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rcore.c b/src/rcore.c
index 9f4af1da..ef261dc2 100644
--- a/src/rcore.c
+++ b/src/rcore.c
@@ -4109,8 +4109,10 @@ static bool InitGraphicsDevice(int width, int height)
{
#if defined(PLATFORM_DESKTOP)
// Center window on screen
- int windowPosX = CORE.Window.display.width/2 - CORE.Window.screen.width/2;
- int windowPosY = CORE.Window.display.height/2 - CORE.Window.screen.height/2;
+ int windowPosX, windowPosY;
+ glfwGetMonitorPos(monitor, &windowPosX, &windowPosY);
+ windowPosX += CORE.Window.display.width/2 - CORE.Window.screen.width/2;
+ windowPosY += CORE.Window.display.height/2 - CORE.Window.screen.height/2;
if (windowPosX < 0) windowPosX = 0;
if (windowPosY < 0) windowPosY = 0;