mirror of
https://github.com/glfw/glfw.git
synced 2024-11-15 02:34:36 +00:00
Fixed some indentations to be consistent with rest of file
This commit is contained in:
parent
6f08e09191
commit
741ad809b1
@ -352,26 +352,27 @@ static char * getAccurateMonitorName(const WCHAR *deviceName)
|
|||||||
if(loadWin7MonitorPointers(&dllPointers) == 0)
|
if(loadWin7MonitorPointers(&dllPointers) == 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
do {
|
do
|
||||||
|
{
|
||||||
rc = dllPointers.m_GetDisplayConfigBufferSizes(QDC_ONLY_ACTIVE_PATHS, &pathCount, &modeCount);
|
rc = dllPointers.m_GetDisplayConfigBufferSizes(QDC_ONLY_ACTIVE_PATHS, &pathCount, &modeCount);
|
||||||
if (rc != ERROR_SUCCESS) {
|
if (rc != ERROR_SUCCESS)
|
||||||
goto GET_ACCURATE_MONITOR_NAME_FAILURE;
|
goto GET_ACCURATE_MONITOR_NAME_FAILURE;
|
||||||
}
|
|
||||||
|
|
||||||
free(paths);
|
free(paths);
|
||||||
free(modes);
|
free(modes);
|
||||||
|
|
||||||
paths = (DISPLAYCONFIG_PATH_INFO *) malloc(sizeof (DISPLAYCONFIG_PATH_INFO) * pathCount);
|
paths = (DISPLAYCONFIG_PATH_INFO *) malloc(sizeof (DISPLAYCONFIG_PATH_INFO) * pathCount);
|
||||||
modes = (DISPLAYCONFIG_MODE_INFO *) malloc(sizeof (DISPLAYCONFIG_MODE_INFO) * modeCount);
|
modes = (DISPLAYCONFIG_MODE_INFO *) malloc(sizeof (DISPLAYCONFIG_MODE_INFO) * modeCount);
|
||||||
if ((paths == NULL) || (modes == NULL)) {
|
if ((paths == NULL) || (modes == NULL))
|
||||||
goto GET_ACCURATE_MONITOR_NAME_FAILURE;
|
goto GET_ACCURATE_MONITOR_NAME_FAILURE;
|
||||||
}
|
|
||||||
|
|
||||||
rc = dllPointers.m_QueryDisplayConfig(QDC_ONLY_ACTIVE_PATHS, &pathCount, paths, &modeCount, modes, 0);
|
rc = dllPointers.m_QueryDisplayConfig(QDC_ONLY_ACTIVE_PATHS, &pathCount, paths, &modeCount, modes, 0);
|
||||||
} while (rc == ERROR_INSUFFICIENT_BUFFER);
|
} while (rc == ERROR_INSUFFICIENT_BUFFER);
|
||||||
|
|
||||||
if (rc == ERROR_SUCCESS) {
|
if (rc == ERROR_SUCCESS)
|
||||||
for (i = 0; i < pathCount; i++) {
|
{
|
||||||
|
for (i = 0; i < pathCount; i++)
|
||||||
|
{
|
||||||
DISPLAYCONFIG_SOURCE_DEVICE_NAME sourceName;
|
DISPLAYCONFIG_SOURCE_DEVICE_NAME sourceName;
|
||||||
DISPLAYCONFIG_TARGET_DEVICE_NAME targetName;
|
DISPLAYCONFIG_TARGET_DEVICE_NAME targetName;
|
||||||
|
|
||||||
@ -381,11 +382,10 @@ static char * getAccurateMonitorName(const WCHAR *deviceName)
|
|||||||
sourceName.header.size = sizeof (sourceName);
|
sourceName.header.size = sizeof (sourceName);
|
||||||
sourceName.header.id = paths[i].sourceInfo.id;
|
sourceName.header.id = paths[i].sourceInfo.id;
|
||||||
rc = dllPointers.m_DisplayConfigGetDeviceInfo(&sourceName.header);
|
rc = dllPointers.m_DisplayConfigGetDeviceInfo(&sourceName.header);
|
||||||
if (rc != ERROR_SUCCESS) {
|
if (rc != ERROR_SUCCESS)
|
||||||
break;
|
break;
|
||||||
} else if (wcscmp(deviceName, sourceName.viewGdiDeviceName) != 0) {
|
else if (wcscmp(deviceName, sourceName.viewGdiDeviceName) != 0)
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
ZeroMemory(&targetName, sizeof(targetName));
|
ZeroMemory(&targetName, sizeof(targetName));
|
||||||
targetName.header.adapterId = paths[i].targetInfo.adapterId;
|
targetName.header.adapterId = paths[i].targetInfo.adapterId;
|
||||||
@ -393,11 +393,13 @@ static char * getAccurateMonitorName(const WCHAR *deviceName)
|
|||||||
targetName.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME;
|
targetName.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME;
|
||||||
targetName.header.size = sizeof (targetName);
|
targetName.header.size = sizeof (targetName);
|
||||||
rc = dllPointers.m_DisplayConfigGetDeviceInfo(&targetName.header);
|
rc = dllPointers.m_DisplayConfigGetDeviceInfo(&targetName.header);
|
||||||
if (rc == ERROR_SUCCESS) {
|
if (rc == ERROR_SUCCESS)
|
||||||
|
{
|
||||||
retval = _glfwCreateUTF8FromWideStringWin32(targetName.monitorFriendlyDeviceName);
|
retval = _glfwCreateUTF8FromWideStringWin32(targetName.monitorFriendlyDeviceName);
|
||||||
/* if we got an empty string, treat it as failure so we'll fallback
|
/* if we got an empty string, treat it as failure so we'll fallback
|
||||||
to getting the generic name. */
|
to getting the generic name. */
|
||||||
if (retval && (*retval == '\0')) {
|
if (retval && (*retval == '\0'))
|
||||||
|
{
|
||||||
free(retval);
|
free(retval);
|
||||||
retval = NULL;
|
retval = NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user