mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 13:04:35 +00:00
parent
c733ab0a22
commit
5c752355cb
@ -361,35 +361,26 @@ void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor,
|
|||||||
_glfwGetMonitorContentScaleWin32(monitor->win32.handle, xscale, yscale);
|
_glfwGetMonitorContentScaleWin32(monitor->win32.handle, xscale, yscale);
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL CALLBACK MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
|
|
||||||
{
|
|
||||||
RECT *workarea = (RECT *)dwData;
|
|
||||||
MONITORINFO monitorInfo;
|
|
||||||
monitorInfo.cbSize = sizeof(MONITORINFO);
|
|
||||||
GetMonitorInfo(hMonitor, &monitorInfo);
|
|
||||||
workarea->left = monitorInfo.rcWork.left;
|
|
||||||
workarea->top = monitorInfo.rcWork.top;
|
|
||||||
workarea->right = monitorInfo.rcWork.right;
|
|
||||||
workarea->bottom = monitorInfo.rcWork.bottom;
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor, int* xpos, int* ypos, int *width, int *height)
|
void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor, int* xpos, int* ypos, int *width, int *height)
|
||||||
{
|
{
|
||||||
HDC dc;
|
MONITORINFO monitorInfo;
|
||||||
RECT workarea;
|
int x, y;
|
||||||
|
POINT pointInMonitor;
|
||||||
|
HMONITOR hMonitor;
|
||||||
|
|
||||||
dc = CreateDCW(L"DISPLAY", monitor->win32.adapterName, NULL, NULL);
|
_glfwPlatformGetMonitorPos( monitor, &x, &y );
|
||||||
|
|
||||||
if (!EnumDisplayMonitors(dc, NULL, MonitorEnumProc, (LPARAM)&workarea))
|
monitorInfo.cbSize = sizeof(MONITORINFO);
|
||||||
return;
|
pointInMonitor.x = x + 1;
|
||||||
|
pointInMonitor.y = y + 1;
|
||||||
|
|
||||||
DeleteDC(dc);
|
hMonitor = MonitorFromPoint( pointInMonitor, 0 );
|
||||||
|
GetMonitorInfo(hMonitor, &monitorInfo);
|
||||||
|
|
||||||
*xpos = workarea.left;
|
*xpos = monitorInfo.rcWork.left;
|
||||||
*ypos = workarea.top;
|
*ypos = monitorInfo.rcWork.top;
|
||||||
*width = workarea.right;
|
*width = monitorInfo.rcWork.right - monitorInfo.rcWork.left;
|
||||||
*height = workarea.bottom;
|
*height = monitorInfo.rcWork.bottom - monitorInfo.rcWork.top;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count)
|
GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count)
|
||||||
|
Loading…
Reference in New Issue
Block a user