Skip to content

Fix for high-dpi resolution when using OpenGL#64

Open
SubstituteR wants to merge 10 commits into
aap:masterfrom
SubstituteR:master
Open

Fix for high-dpi resolution when using OpenGL#64
SubstituteR wants to merge 10 commits into
aap:masterfrom
SubstituteR:master

Conversation

@SubstituteR

Copy link
Copy Markdown

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
Copy Markdown
Author

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

@halpz

halpz commented Feb 25, 2021

Copy link
Copy Markdown

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

@halpz

halpz commented Feb 25, 2021

Copy link
Copy Markdown

(external monitor was working fine for both before)

@halpz

halpz commented Feb 25, 2021

Copy link
Copy Markdown

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

@SubstituteR

Copy link
Copy Markdown
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

halpz commented Feb 25, 2021

Copy link
Copy Markdown

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

halpz commented Feb 25, 2021

Copy link
Copy Markdown

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

@SubstituteR

Copy link
Copy Markdown
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

halpz commented Feb 25, 2021

Copy link
Copy Markdown

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

@SubstituteR

Copy link
Copy Markdown
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

halpz commented Feb 25, 2021

Copy link
Copy Markdown

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
Copy Markdown
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

halpz commented Feb 25, 2021

Copy link
Copy Markdown

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

@SubstituteR

SubstituteR commented Feb 25, 2021

Copy link
Copy Markdown
Author

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

aap commented Feb 26, 2021

Copy link
Copy Markdown
Owner

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
Copy Markdown
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

palmerj commented Oct 27, 2022

Copy link
Copy Markdown

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

palmerj commented Oct 30, 2022

Copy link
Copy Markdown

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