mirror of
https://github.com/glfw/glfw.git
synced 2025-10-05 06:06:36 +00:00
Update query for work area on Windows
This commit is contained in:
parent
d4a0764464
commit
2b7ed3d177
@ -291,6 +291,36 @@ void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos)
|
|||||||
*ypos = settings.dmPosition.y;
|
*ypos = settings.dmPosition.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static BOOL CALLBACK MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)
|
||||||
|
{
|
||||||
|
RECT *workarea = (RECT *)dwData;
|
||||||
|
MONITORINFO 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)
|
||||||
|
{
|
||||||
|
HDC dc;
|
||||||
|
RECT workarea;
|
||||||
|
|
||||||
|
dc = CreateDCW(L"DISPLAY", monitor->win32.adapterName, NULL, NULL);
|
||||||
|
|
||||||
|
if (!EnumDisplayMonitors(dc, NULL, MonitorEnumProc, (LPARAM)&workarea))
|
||||||
|
return;
|
||||||
|
|
||||||
|
DeleteDC(dc);
|
||||||
|
|
||||||
|
*xpos = workarea.left;
|
||||||
|
*ypos = workarea.top;
|
||||||
|
*width = workarea.right;
|
||||||
|
*height = workarea.bottom;
|
||||||
|
}
|
||||||
|
|
||||||
GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count)
|
GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count)
|
||||||
{
|
{
|
||||||
int modeIndex = 0, size = 0;
|
int modeIndex = 0, size = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user