Add support for enabling high DPI#1
Add support for enabling high DPI#1Fadenfire wants to merge 2 commits intoMinecraftMachina:masterfrom
Conversation
|
Any news on this? |
|
Hey @Fadenfire, really sorry for not responding before, it seems like GitHub disables notifications for forks (like this repo), so I never got any notification about your PR. I just stumbled on it now by accident. |
|
Looking at the existing behavior, we have: lwjgl/src/java/org/lwjgl/opengl/MacOSXDisplay.java Lines 143 to 144 in 5cd6ba7 With your proposed change, it seems like the DPI code will activate for fullscreen on vanilla Minecraft. What will be the side effects from that? |
|
Thanks for catching that, I didn't see that |
|
Any updates on this? This currently breaks something similar I am trying |
|
@ViRb3 Since you mentioned you don't get notifications for forks and it's been 2 years, do you still plan to merge this? |
(cherry picked from commit 652dd2c)
I am currently working on a mod that allows Minecraft versions prior to 1.13 to take advantage of high DPI screens on macOS. To accomplish this I am setting the
org.lwjgl.opengl.Display.enableHighDPIproperty to true on startup and then injecting calls toDisplay.getPixelScaleFactor()into Minecraft's code to scale the GUI properly. This works fine when using Mojang's LWJGL 2 libraries with x86_64 java, but when using the binaries provided by this repository with aarch64 java my mod ceases to work. The Minecraft window will only display the bottom left corner of the framebuffer.After some research, I figured out that this is caused by eed74ff. I assume that this change was made to fix the issue with macOS defaulting to a high DPI framebuffer (I discovered that issue when I reverted this commit to see what would happen). That change is fine for normal Minecraft, because it doesn't make use of LWJGL 2's high DPI mode, but it prevents my mod from working.
This PR changes that line so that instead of always setting
setWantsBestResolutionOpenGLSurfacetoNO, it'll set it toYESif high DPI mode is enabled andNOif it isn't. This should fix my issue while maintaining compatibility with everyone else. Let me know if you see any problems with my solution.