Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for high-dpi resolution when using OpenGL #64

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

SubstituteR
Copy link

This is a fix for #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.

@SubstituteR
Copy link
Author

Looks like I'll have to add the null to the other devices.

@halpz
Copy link

halpz commented Feb 25, 2021

this fixes GTA3, but causes scaling issues on vice city when using an external monitor (mac M1)

@halpz
Copy link

halpz commented Feb 25, 2021

(external monitor was working fine for both before)

@halpz
Copy link

halpz commented Feb 25, 2021

actually it still only fills 1/4 of the screen in both on my M1 macbook pro screen

@SubstituteR
Copy link
Author

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.

@halpz
Copy link

halpz commented Feb 25, 2021

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)

@halpz
Copy link

halpz commented Feb 25, 2021

screenshot: https://i.imgur.com/IlxajkA.jpg

@SubstituteR
Copy link
Author

screenshot: https://i.imgur.com/IlxajkA.jpg

Strange, which macbook and which version of OSX?
On my end both VC and III work fine.
Screen Shot 2021-02-25 at 12 08 28 PM
Screen Shot 2021-02-25 at 12 07 22 PM

@halpz
Copy link

halpz commented Feb 25, 2021

latest OS and MBP M1 16gb,
maybe i'm making a mistake, what's your build process?

@SubstituteR
Copy link
Author

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?

@halpz
Copy link

halpz commented Feb 25, 2021

Same for me. No special settings - should it work by simply replacing the librw folder with yours? Or is there another step ?

@SubstituteR
Copy link
Author

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.

@halpz
Copy link

halpz commented Feb 25, 2021

Happy to try it to rule out any mistakes on my side !

@SubstituteR
Copy link
Author

SubstituteR commented Feb 25, 2021

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.

@aap
Copy link
Owner

aap commented Feb 26, 2021

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.

@SubstituteR
Copy link
Author

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

@palmerj
Copy link

palmerj commented Oct 27, 2022

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

Screen Shot 2022-10-27 at 10 30 31 pm

@palmerj
Copy link

palmerj commented Oct 30, 2022

Ok this is resolved for me by using glfw 3.3.8. Nice got it working well on a intel macbook!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants