Hello Guest

4k monitor scaling on windows

  • 1 Replies
  • 62 Views
4k monitor scaling on windows
« on: August 28, 2018, 17:33:08 »
I have a huge 4k monitor, and my problem is similar to this: https://github.com/glfw/glfw/issues/676

They added two new hints:
  • - GLFW_WIN32_DPI_RESIZE
  • - GLFW_X11_DPI_RESIZE

What do you think, when it will be in LWJGL?

So in code level, this is my code that calculates what is the screen scale factor. On a retina macbook it returns 2, on a simple full HD monitor it returns 1. The problem, that on the 4K monitor it returns 1 as well.

Code: [Select]
glfwGetWindowSize(EngineProperties.activeWindowID, widthScreenCoordBuf, heightScreenCoordBuf);
glfwGetFramebufferSize(EngineProperties.activeWindowID, widthPixelsBuf, heightPixelsBuf);

EngineProperties.screenScaleFactor = (int) Math.floor(widthPixelsBuf.get() / widthScreenCoordBuf.get());

*

Online spasi

  • *****
  • 2028
    • WebHotelier
Re: 4k monitor scaling on windows
« Reply #1 on: August 28, 2018, 20:02:08 »
The hints will be added as soon as the relevant commits make it to GLFW's master branch (which means they're fully tested and stable).

Note that, if you'd like to test it now, you can easily create a custom GLFW build and use that instead of the one provided by LWJGL (see org.lwjgl.system.Configuration.GLFW_LIBRARY_NAME).