This commit is contained in:
Camilla Löwy 2017-08-27 23:09:08 +02:00
parent 45ca8b8d19
commit d8551b73f6
2 changed files with 16 additions and 17 deletions

View File

@ -142,8 +142,8 @@ void _glfwPollMonitorsWin32(void)
{ {
int type = _GLFW_INSERT_LAST; int type = _GLFW_INSERT_LAST;
ZeroMemory(&adapter, sizeof(DISPLAY_DEVICEW)); ZeroMemory(&adapter, sizeof(adapter));
adapter.cb = sizeof(DISPLAY_DEVICEW); adapter.cb = sizeof(adapter);
if (!EnumDisplayDevicesW(NULL, adapterIndex, &adapter, 0)) if (!EnumDisplayDevicesW(NULL, adapterIndex, &adapter, 0))
break; break;
@ -156,8 +156,8 @@ void _glfwPollMonitorsWin32(void)
for (displayIndex = 0; ; displayIndex++) for (displayIndex = 0; ; displayIndex++)
{ {
ZeroMemory(&display, sizeof(DISPLAY_DEVICEW)); ZeroMemory(&display, sizeof(display));
display.cb = sizeof(DISPLAY_DEVICEW); display.cb = sizeof(display);
if (!EnumDisplayDevicesW(adapter.DeviceName, displayIndex, &display, 0)) if (!EnumDisplayDevicesW(adapter.DeviceName, displayIndex, &display, 0))
break; break;
@ -244,7 +244,7 @@ GLFWbool _glfwSetVideoModeWin32(_GLFWmonitor* monitor, const GLFWvidmode* desire
return GLFW_TRUE; return GLFW_TRUE;
ZeroMemory(&dm, sizeof(dm)); ZeroMemory(&dm, sizeof(dm));
dm.dmSize = sizeof(DEVMODEW); dm.dmSize = sizeof(dm);
dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL | dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL |
DM_DISPLAYFREQUENCY; DM_DISPLAYFREQUENCY;
dm.dmPelsWidth = best->width; dm.dmPelsWidth = best->width;
@ -309,19 +309,19 @@ void _glfwRestoreVideoModeWin32(_GLFWmonitor* monitor)
void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos) void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos)
{ {
DEVMODEW settings; DEVMODEW dm;
ZeroMemory(&settings, sizeof(DEVMODEW)); ZeroMemory(&dm, sizeof(dm));
settings.dmSize = sizeof(DEVMODEW); dm.dmSize = sizeof(dm);
EnumDisplaySettingsExW(monitor->win32.adapterName, EnumDisplaySettingsExW(monitor->win32.adapterName,
ENUM_CURRENT_SETTINGS, ENUM_CURRENT_SETTINGS,
&settings, &dm,
EDS_ROTATEDMODE); EDS_ROTATEDMODE);
if (xpos) if (xpos)
*xpos = settings.dmPosition.x; *xpos = dm.dmPosition.x;
if (ypos) if (ypos)
*ypos = settings.dmPosition.y; *ypos = dm.dmPosition.y;
} }
GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count) GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count)
@ -337,8 +337,8 @@ GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count)
GLFWvidmode mode; GLFWvidmode mode;
DEVMODEW dm; DEVMODEW dm;
ZeroMemory(&dm, sizeof(DEVMODEW)); ZeroMemory(&dm, sizeof(dm));
dm.dmSize = sizeof(DEVMODEW); dm.dmSize = sizeof(dm);
if (!EnumDisplaySettingsW(monitor->win32.adapterName, modeIndex, &dm)) if (!EnumDisplaySettingsW(monitor->win32.adapterName, modeIndex, &dm))
break; break;
@ -404,9 +404,8 @@ GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count)
void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode) void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode)
{ {
DEVMODEW dm; DEVMODEW dm;
ZeroMemory(&dm, sizeof(dm));
ZeroMemory(&dm, sizeof(DEVMODEW)); dm.dmSize = sizeof(dm);
dm.dmSize = sizeof(DEVMODEW);
EnumDisplaySettingsW(monitor->win32.adapterName, ENUM_CURRENT_SETTINGS, &dm); EnumDisplaySettingsW(monitor->win32.adapterName, ENUM_CURRENT_SETTINGS, &dm);

View File

@ -111,7 +111,7 @@ static HICON createIcon(const GLFWimage* image,
unsigned char* source = image->pixels; unsigned char* source = image->pixels;
ZeroMemory(&bi, sizeof(bi)); ZeroMemory(&bi, sizeof(bi));
bi.bV5Size = sizeof(BITMAPV5HEADER); bi.bV5Size = sizeof(bi);
bi.bV5Width = image->width; bi.bV5Width = image->width;
bi.bV5Height = -image->height; bi.bV5Height = -image->height;
bi.bV5Planes = 1; bi.bV5Planes = 1;