LWJGL Forum

Programming => OpenGL => Topic started by: mudlee on August 28, 2018, 17:33:08

Title: 4k monitor scaling on windows
Post by: mudlee 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:

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());
Title: Re: 4k monitor scaling on windows
Post by: spasi 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).
Title: Re: 4k monitor scaling on windows
Post by: spasi on September 29, 2018, 22:16:48
This will be available in LWJGL 3.2.1 snapshot 3. Instead of separate hints for each platform, there's just one hint in the final version: GLFW_SCALE_TO_MONITOR.