Implemented getting the display name on Windows
authorSam Lantinga <slouken@libsdl.org>
Mon, 31 Dec 2012 15:36:19 -0800
changeset 6793 c8d1036975b7
parent 6792 a15821a3471f
child 6794 a0d42781fa92
Implemented getting the display name on Windows
src/video/windows/SDL_windowsmodes.c
--- a/src/video/windows/SDL_windowsmodes.c	Mon Dec 31 14:57:36 2012 -0800
+++ b/src/video/windows/SDL_windowsmodes.c	Mon Dec 31 15:36:19 2012 -0800
@@ -127,6 +127,7 @@
     SDL_VideoDisplay display;
     SDL_DisplayData *displaydata;
     SDL_DisplayMode mode;
+    DISPLAY_DEVICE device;
 
 #ifdef DEBUG_MODES
     printf("Display: %s\n", WIN_StringToUTF8(DeviceName));
@@ -143,10 +144,15 @@
                sizeof(displaydata->DeviceName));
 
     SDL_zero(display);
+    device.cb = sizeof(device);
+    if (EnumDisplayDevices(DeviceName, 0, &device, 0)) {
+        display.name = WIN_StringToUTF8(device.DeviceString);
+    }
     display.desktop_mode = mode;
     display.current_mode = mode;
     display.driverdata = displaydata;
     SDL_AddVideoDisplay(&display);
+    SDL_free(display.name);
     return SDL_TRUE;
 }