Added glfwGet*Adapter to native API.

This commit is contained in:
Camilla Berglund
2014-10-28 15:35:03 +01:00
parent 6743761c2c
commit 49ec306a0a
5 changed files with 59 additions and 7 deletions
+16 -3
View File
@@ -160,10 +160,16 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
wcscpy(monitors[found]->win32.adapterName, adapter.DeviceName);
wcscpy(monitors[found]->win32.displayName, display.DeviceName);
WideCharToMultiByte(CP_UTF8, 0,
adapter.DeviceName, -1,
monitors[found]->win32.publicAdapterName,
sizeof(monitors[found]->win32.publicAdapterName),
NULL, NULL);
WideCharToMultiByte(CP_UTF8, 0,
display.DeviceName, -1,
monitors[found]->win32.nativeName,
sizeof(monitors[found]->win32.nativeName),
monitors[found]->win32.publicDisplayName,
sizeof(monitors[found]->win32.publicDisplayName),
NULL, NULL);
if (adapter.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE &&
@@ -326,10 +332,17 @@ void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp)
////// GLFW native API //////
//////////////////////////////////////////////////////////////////////////
GLFWAPI const char* glfwGetWin32Adapter(GLFWmonitor* handle)
{
_GLFWmonitor* monitor = (_GLFWmonitor*) handle;
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
return monitor->win32.publicAdapterName;
}
GLFWAPI const char* glfwGetWin32Monitor(GLFWmonitor* handle)
{
_GLFWmonitor* monitor = (_GLFWmonitor*) handle;
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
return monitor->win32.nativeName;
return monitor->win32.publicDisplayName;
}
+2 -1
View File
@@ -205,7 +205,8 @@ typedef struct _GLFWmonitorWin32
// This size matches the static size of DISPLAY_DEVICE.DeviceName
WCHAR adapterName[32];
WCHAR displayName[32];
char nativeName[64];
char publicAdapterName[64];
char publicDisplayName[64];
GLboolean modeChanged;
} _GLFWmonitorWin32;
+7
View File
@@ -465,6 +465,13 @@ void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp)
////// GLFW native API //////
//////////////////////////////////////////////////////////////////////////
GLFWAPI RRCrtc glfwGetX11Adapter(GLFWmonitor* handle)
{
_GLFWmonitor* monitor = (_GLFWmonitor*) handle;
_GLFW_REQUIRE_INIT_OR_RETURN(None);
return monitor->x11.crtc;
}
GLFWAPI RROutput glfwGetX11Monitor(GLFWmonitor* handle)
{
_GLFWmonitor* monitor = (_GLFWmonitor*) handle;