librw
librw copied to clipboard
Fix for high-dpi resolution when using OpenGL
This is a fix for https://github.com/aap/librw/issues/63
Other device apis should be checked for regressions. There is an added inline for the null device that returns a scaling factor of 1,1 but unsure if this alone is enough to satisfy other apis.
Looks like I'll have to add the null to the other devices.
this fixes GTA3, but causes scaling issues on vice city when using an external monitor (mac M1)
(external monitor was working fine for both before)
actually it still only fills 1/4 of the screen in both on my M1 macbook pro screen
this fixes GTA3, but causes scaling issues on vice city when using an external monitor (mac M1)
Can you describe the issue? I haven’t built Vice City on my M1. As for the overall size, was that a problem on GTA 3 as well? I don’t have an external monitor, so I can’t reliably test that. On my M1 with hidpi on and off though I have no problem.
I clone your fork and drop the librw folder into the vendor folder of the game project, build all targets and on my macbook screen, the video doesn't fill the whole screen, just a portion of it (in both gta3 and vice city)
screenshot: https://i.imgur.com/IlxajkA.jpg
screenshot: https://i.imgur.com/IlxajkA.jpg
Strange, which macbook and which version of OSX?
On my end both VC and III work fine.
latest OS and MBP M1 16gb, maybe i'm making a mistake, what's your build process?
latest OS and MBP M1 16gb, maybe i'm making a mistake, what's your build process?
I use GMAKE2 from the premake.
make config=release_macosx-arm64-librw_gl3_glfw-oal all
I had to update the make files to point to the homebrew folder though. I have the same laptop but 8GB model. What is your display settings?
Same for me. No special settings - should it work by simply replacing the librw folder with yours? Or is there another step ?
Same for me. No special settings - should it work by simply replacing the librw folder with yours? Or is there another step ?
I changed and pulled the latest. I could see about uploading a build from my machine to see the behavior on yours.
Happy to try it to rule out any mistakes on my side !
Happy to try it to rule out any mistakes on my side !
http://pocketdevs.org/re3
Drop that in your install directory and then just ./re3
.
This looks extremely hacky and I won't merge it unless there is absolutely no other way around it. Would be better to figure out what the actual cause for the bug is. my opengl code isn't the best so it's quite likely it can be fixed cleanly.
This looks extremely hacky
I agree
Would be better to figure out what the actual cause for the bug is.
When trying to fix it, changing the frame buffer manually to the w,h from glfwGetFramebufferSize
properly renders the game-world, but as OpenGL operates on relative units, the menu / 2D layer becomes small (half resolution on x and y)
I've never used OpenGL before, but I can keep looking. You can see a similar issue https://stackoverflow.com/questions/12821144/how-to-draw-text-in-opengl-on-mac-os-with-retina-display
Did anyone come up with robust solution for this. I'm on an Intel Mac with Monterey and it's an issue when using a HiDPI display preference with librw master. See
Ok this is resolved for me by using glfw 3.3.8. Nice got it working well on a intel macbook!