mirror of
https://github.com/glfw/glfw.git
synced 2026-09-21 00:30:57 +00:00
Added glfwGet*Adapter to native API.
This commit is contained in:
+16
-3
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user