diff options
| author | ubkp <[email protected]> | 2023-10-19 08:09:27 -0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-10-19 13:09:27 +0200 |
| commit | a64d606cb3aa55df0f01f75b8db0ca6b9a06b562 (patch) | |
| tree | dbf344cb88a93a558bf0081a836a6f16ebffd97c | |
| parent | f09840dcdc00d1a83479d7d8010968e090d110c0 (diff) | |
| download | raylib-a64d606cb3aa55df0f01f75b8db0ca6b9a06b562.tar.gz raylib-a64d606cb3aa55df0f01f75b8db0ca6b9a06b562.zip | |
Fix GetMonitorPhysical* dpi (#3442)
| -rw-r--r-- | src/rcore_desktop_sdl.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/rcore_desktop_sdl.c b/src/rcore_desktop_sdl.c index fedebeee..c574b819 100644 --- a/src/rcore_desktop_sdl.c +++ b/src/rcore_desktop_sdl.c @@ -230,7 +230,7 @@ void ToggleFullscreen(void) else { SDL_SetWindowFullscreen(platform.window, 0); - CORE.Window.flags &= ~FLAG_FULLSCREEN_MODE; + CORE.Window.flags &= ~FLAG_FULLSCREEN_MODE; } } @@ -725,12 +725,12 @@ int GetMonitorPhysicalWidth(int monitor) if ((monitor >= 0) && (monitor < monitorCount)) { - float vdpi = 0.0f; - SDL_GetDisplayDPI(monitor, NULL, NULL, &vdpi); + float ddpi = 0.0f; + SDL_GetDisplayDPI(monitor, &ddpi, NULL, NULL); SDL_DisplayMode mode; SDL_GetCurrentDisplayMode(monitor, &mode); // Calculate size on inches, then convert to millimeter - if (vdpi > 0.0f) width = (mode.w/vdpi)*25.4f; + if (ddpi > 0.0f) width = (mode.w/ddpi)*25.4f; } else TRACELOG(LOG_WARNING, "SDL: Failed to find selected monitor"); @@ -747,12 +747,12 @@ int GetMonitorPhysicalHeight(int monitor) if ((monitor >= 0) && (monitor < monitorCount)) { - float vdpi = 0.0f; - SDL_GetDisplayDPI(monitor, NULL, NULL, &vdpi); + float ddpi = 0.0f; + SDL_GetDisplayDPI(monitor, &ddpi, NULL, NULL); SDL_DisplayMode mode; SDL_GetCurrentDisplayMode(monitor, &mode); // Calculate size on inches, then convert to millimeter - if (vdpi > 0.0f) height = (mode.h/vdpi)*25.4f; + if (ddpi > 0.0f) height = (mode.h/ddpi)*25.4f; } else TRACELOG(LOG_WARNING, "SDL: Failed to find selected monitor"); |
