diff options
| author | Random <[email protected]> | 2022-09-30 01:09:49 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-09-30 10:09:49 +0200 |
| commit | f14955512f4c47e9b77cd5e17b969a43543ec705 (patch) | |
| tree | ff8de001b0bb1f3d0003f0cfc763d65a4c6406d4 /src/rcore.c | |
| parent | 45da03df236db2090ac9a53aac572b0b91278a64 (diff) | |
| download | raylib-f14955512f4c47e9b77cd5e17b969a43543ec705.tar.gz raylib-f14955512f4c47e9b77cd5e17b969a43543ec705.zip | |
fix issue #2728 (#2731)
* fix issue #2728
* updated gamecontrollerdb: fixes GLFW warning due to invalid entry
Diffstat (limited to 'src/rcore.c')
| -rw-r--r-- | src/rcore.c | 6 |
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; |
