Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Implemented getting the display name on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Dec 31, 2012
1 parent 15f8982 commit fa8d780
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/video/windows/SDL_windowsmodes.c
Expand Up @@ -127,6 +127,7 @@ WIN_AddDisplay(LPTSTR DeviceName)
SDL_VideoDisplay display;
SDL_DisplayData *displaydata;
SDL_DisplayMode mode;
DISPLAY_DEVICE device;

#ifdef DEBUG_MODES
printf("Display: %s\n", WIN_StringToUTF8(DeviceName));
Expand All @@ -143,10 +144,15 @@ WIN_AddDisplay(LPTSTR DeviceName)
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;
}

Expand Down

0 comments on commit fa8d780

Please sign in to comment.