Skip to content

[idea] macOS - seamless retina window (high res or not) #8365

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

Open
dimitre opened this issue Mar 9, 2025 · 6 comments
Open

[idea] macOS - seamless retina window (high res or not) #8365

dimitre opened this issue Mar 9, 2025 · 6 comments
Milestone

Comments

@dimitre
Copy link
Member

dimitre commented Mar 9, 2025

I finally found everything to make retina work with a seamless window.
Basically everything will work the same and only pixel density will change.

It is working great in the fork I'm using.
I'll explain what the changes are if anybody wants to port to OF.

GLFW window size and mouse will not be doubled in retina. everything is the same.
I've just removed pixelcoordscale, not relevant anymore.
we have to consider the framebuffer size and window size and have the appropriate GLFW callbacks.
ofMatrixStack::getRenderSurfaceSize() have to consider currentWindow->getFramebufferSize();

I'm using always high resolution on PLIST now, so the window decorations are not pixelated (title bar and colored buttons)
this can be switched in ofWindowSettings, so GLFW will handle the way framebuffer works.

// In this fork there is only ofWindowSettings, no inheritance for settings
	ofWindowSettings settings;
	settings.highResolutionCapable = true;

Some related commits:
dimitre@001cec0
dimitre@aa82c6b
dimitre@ba9de37

@dimitre
Copy link
Member Author

dimitre commented Mar 9, 2025

I'll keep using settings.highResolutionCapable = false for some pixel sharp fonts interface.
They can get a little bit blurry on retina. but much better for smooth fonts

@dimitre
Copy link
Member Author

dimitre commented Mar 10, 2025

Last missing detail, fixing ofDrawBitmapString, by changing

		rViewport = getCurrentViewport();

to

		rViewport = matrixStack.getFullSurfaceViewport();
Image Image

@ofTheo
Copy link
Member

ofTheo commented Mar 10, 2025

@dimitre this looks like a great middle ground solution.
Def be worth a PR immediately after 0.12.1

@dimitre dimitre added this to the 0.12.2 milestone Mar 10, 2025
@dimitre
Copy link
Member Author

dimitre commented Mar 13, 2025

one more commit to complete ofDrawBitmapString
dimitre@cae4e9e

@dimitre dimitre changed the title [macOS] seamless retina window (high res or not) [idea] macOS - seamless retina window (high res or not) Mar 25, 2025
@danomatika
Copy link
Contributor

Thanks for digging into this. I figured it was be more or less straightforward, just finding all the detailed spots to adjust to the right calls.

@dimitre
Copy link
Member Author

dimitre commented Apr 9, 2025

Great @danomatika testing is welcome
this fork has a different project generator and libs, works for macos and linux only
https://github.com/dimitre/ofworks/

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

No branches or pull requests

3 participants