# DPI-aware, Content scale

**URL:** <https://discourse.glfw.org/t/dpi-aware-content-scale/2251>\
**Category:** support\
**Created:** [December 8, 2022, 2:27pm UTC](https://discourse.glfw.org/t/dpi-aware-content-scale/2251 "2022-12-08T14:27:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![peter.dev](https://avatars.discourse-cdn.com/v4/letter/p/e68b1a/32.png) [@peter.dev](https://discourse.glfw.org/u/peter.dev)\
**Post date:** [December 8, 2022, 2:27pm UTC](https://discourse.glfw.org/t/dpi-aware-content-scale/2251/1 "2022-12-08T14:27:05Z")

</div>

Hey!

When should I use **glfwGetWindowContentScale** instead of **glfwGetMonitorContentScale** and vice versa?

Is this combination enough to make my application DPI-aware?  
- **glfwGetWindowContentScale** at init phase.  
- **glfwSetWindowContentScaleCallback** after init phase.  
- **GLFW\_SCALE\_TO\_MONITOR**

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [December 8, 2022, 2:43pm UTC](https://discourse.glfw.org/t/dpi-aware-content-scale/2251/2 "2022-12-08T14:43:09Z")

</div>

Make sure to read the documentation [content scale](https://www.glfw.org/docs/3.3/monitor_guide.html#monitor_scale) and [window content scale](https://www.glfw.org/docs/3.3/window_guide.html#window_scale).

Essentially each monitor may have a content scale and the content scale of a window depends on which which monitor the _system considers the window to be on_. Using the window content scale is a reliable method.

The window hint [GLFW\_SCALE\_TO\_MONITOR](https://www.glfw.org/docs/3.3/window_guide.html#GLFW_SCALE_TO_MONITOR) will automatically scale your window size by the content scale. Whether you want to do this depends on your application.

On MacOS the window size and framebuffer size may differ, so these also need to be taken into account.

---

<div class="post-metadata">

**Author:** ![peter.dev](https://avatars.discourse-cdn.com/v4/letter/p/e68b1a/32.png) [@peter.dev](https://discourse.glfw.org/u/peter.dev)\
**Post date:** [December 26, 2022, 12:51am UTC](https://discourse.glfw.org/t/dpi-aware-content-scale/2251/3 "2022-12-26T00:51:37Z")

</div>

Sorry for the late reply.  
Thank you for your explanation and links.
