Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix scaling on HiDPI screens with Wayland (#171)
* Fix scaling on HiDPI screens with Wayland The game expects getWidth and getHeight to return framebuffer coordinates rather than screen-space coordinates (as shown by the calls to glViewport). This was broken on scaling factors greater than 1 but also masked by GL_SCALE_FRAMEBUFFER. Additionally, the game's mouse code *also* expects framebuffer coordinates to be returned. This fixes that by converting to and from screen-space during calls to mouse code. Disable GLFW_COCOA_RETINA_FRAMEBUFFER for now, it seems to not play nice on non-MacOS systems. At least for me it makes the title screen larger than the window when playing in fullscreen * add back hack for macOS I think their framebuffer implementation is buggy? I don't really want to touch this since I don't have a Mac to test on I think their GPUs are weak anyways and probably can't handle rendering GTNH at 260 DPI or whatever Retina does * Fix getPixelScaleFactor Previous implementation was broken on hidpi platforms where the size of the framebuffer and the size of the window correlate 1:1. This manifested in the mouse code thinking the mouse was in a different location than it actually was. New implementation explicitly calculates the ratio between the framebuffer size and the window size, rather than relying on glfwGetWindowContentScale. Remove GLFW_SCALE_FRAMEBUFFER/GLFW_COCOA_RETINA_FRAMEBUFFER, it appears that it is not needed. * fucking spotless
- Loading branch information