From 13c03453d5db97cf885d29f666e42819db521335 Mon Sep 17 00:00:00 2001 From: ubkp <118854183+ubkp@users.noreply.github.com> Date: Mon, 16 Oct 2023 23:17:33 -0300 Subject: [PATCH] Add missing implementations 2 --- src/rcore_desktop_sdl.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/rcore_desktop_sdl.c b/src/rcore_desktop_sdl.c index c1ca2cd13..d1930f507 100644 --- a/src/rcore_desktop_sdl.c +++ b/src/rcore_desktop_sdl.c @@ -414,15 +414,24 @@ int GetMonitorRefreshRate(int monitor) // Get the human-readable, UTF-8 encoded name of the selected monitor const char *GetMonitorName(int monitor) { - TRACELOG(LOG_WARNING, "GetMonitorName() not implemented on target platform"); + int monitorCount = 0; + monitorCount = SDL_GetNumVideoDisplays(); + + if ((monitor >= 0) && (monitor < monitorCount)) return SDL_GetDisplayName(monitor); + else TRACELOG(LOG_WARNING, "SDL: Failed to find selected monitor"); + return ""; } // Get window position XY on monitor Vector2 GetWindowPosition(void) { - TRACELOG(LOG_WARNING, "GetWindowPosition() not implemented on target platform"); - return (Vector2){ 0, 0 }; + int x = 0; + int y = 0; + + SDL_GetWindowPosition(platform.window, &x, &y); + + return (Vector2){ (float)x, (float)y }; } // Get window scale DPI factor for current monitor