Add content scale queries

This adds glfwGetWindowContentScale and glfwGetMonitorContentScale for
querying the recommended drawing scale factor for DPI-aware rendering.

Parts of this patch are based on code by @ferreiradaselva.

Fixes #235.
Fixes #439.
Fixes #677.
Fixes #845.
Fixes #898.
This commit is contained in:
Camilla Löwy
2017-08-29 19:19:00 +02:00
parent 1be81a1540
commit 16bf872117
26 changed files with 387 additions and 28 deletions
+9
View File
@@ -550,6 +550,15 @@ void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window,
// implemented, but for now just leave everything as 0.
}
void _glfwPlatformGetWindowContentScale(_GLFWwindow* window,
float* xscale, float* yscale)
{
if (xscale)
*xscale = (float) window->wl.scale;
if (yscale)
*yscale = (float) window->wl.scale;
}
void _glfwPlatformIconifyWindow(_GLFWwindow* window)
{
// TODO: move to xdg_shell instead of wl_shell.