Add glfwSetWindowContentScaleCallback

Related to #677.
Related to #1115.
This commit is contained in:
Camilla Löwy
2017-12-11 21:26:40 +01:00
parent 1034b6e0db
commit 370eac3c48
10 changed files with 120 additions and 3 deletions

View File

@@ -64,6 +64,9 @@ GLFW now supports querying the window and monitor content scale, i.e. the ratio
between the current DPI and the platform's default DPI, with @ref
glfwGetWindowContentScale and @ref glfwGetMonitorContentScale.
Changes of the content scale of a window can be received with the window content
scale callback, set with @ref glfwSetWindowCloseCallback.
@see @ref window_scale

View File

@@ -695,6 +695,23 @@ On systems where each monitors can have its own content scale, the window
content scale will depend on which monitor the system considers the window to be
on.
If you wish to be notified when the content scale of a window changes, whether
because of a system setting change or because it was moved to a monitor with
a different scale, set a content scale callback.
@code
glfwSetWindowContentScaleCallback(window, window_content_scale_callback);
@endcode
The callback function receives the new content scale of the window.
@code
void window_content_scale_callback(GLFWwindow* window, float xscale, float yscale)
{
set_interface_scale(xscale, yscale);
}
@endcode
@subsection window_sizelimits Window size limits