mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-14 03:39:57 +01:00
backward compatibility with glfw v3.2
This commit is contained in:
@@ -448,7 +448,14 @@ GLFWmonitor *RenderingWindow::monitorAt(int x, int y)
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
for (; i < count_monitors; i++) {
|
for (; i < count_monitors; i++) {
|
||||||
int workarea_x, workarea_y, workarea_width, workarea_height;
|
int workarea_x, workarea_y, workarea_width, workarea_height;
|
||||||
|
#if GLFW_VERSION_MINOR > 2
|
||||||
glfwGetMonitorWorkarea(monitors[i], &workarea_x, &workarea_y, &workarea_width, &workarea_height);
|
glfwGetMonitorWorkarea(monitors[i], &workarea_x, &workarea_y, &workarea_width, &workarea_height);
|
||||||
|
#else
|
||||||
|
glfwGetMonitorPos(monitors[i], &workarea_x, &workarea_y);
|
||||||
|
const GLFWvidmode *vm = glfwGetVideoMode(monitors[i]);
|
||||||
|
workarea_width = vm->width;
|
||||||
|
workarea_height = vm->height;
|
||||||
|
#endif
|
||||||
if ( x >= workarea_x && x <= workarea_x + workarea_width &&
|
if ( x >= workarea_x && x <= workarea_x + workarea_width &&
|
||||||
y >= workarea_y && y <= workarea_y + workarea_height)
|
y >= workarea_y && y <= workarea_y + workarea_height)
|
||||||
break;
|
break;
|
||||||
@@ -545,10 +552,7 @@ int RenderingWindow::height()
|
|||||||
|
|
||||||
int RenderingWindow::maxHeight()
|
int RenderingWindow::maxHeight()
|
||||||
{
|
{
|
||||||
int workarea_x, workarea_y, workarea_width, workarea_height;
|
return glfwGetVideoMode(monitor())->height;
|
||||||
glfwGetMonitorWorkarea(monitor(), &workarea_x, &workarea_y, &workarea_width, &workarea_height);
|
|
||||||
|
|
||||||
return workarea_height * dpi_scale_;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float RenderingWindow::aspectRatio()
|
float RenderingWindow::aspectRatio()
|
||||||
|
|||||||
Reference in New Issue
Block a user