Resolution in gl context doesn't fit with ofGetWidth()?

Hi OF community !

I just need some clarification about this ?

I see in “about this mac” that my screen has 2880/1800 pixels resolution.
I set in main.cpp -> ofSetupOpenGL(1920,1080,OF_FULLSCREEN);

when I call ofGetWidth() in ofApp::setup(), I cannot get value higher than 1680/951 ?
I was expecting to get 1920/1080.

when I call ofGetScreenWidth() / Height(), I get 1680/1050 ?
here I was expecting 2880/1800.

What am I missing ?
or maybe someone can point me to documentation that explain that ?

Thank you !

That resolution that About my mac gives you is the retina resolution. But the of app runs in non retina resolution, which is half of that. This is mostly so whatever you code in a retina screen will look at the same size in a non retina screen.
Yet you can make the app to run in retina resolution by doing the following.
In Xcode, in the left pane locate the file openFrameworks-Info.plist and clic on it. It will show a bunch of settings in the editor. There add a new field, and put in its key field High Resolution Capable and YES in the value field. Compile again, now your app will be running on retina resolution.

Btw, I am not completely sure but I think there is a bug when using ofSetupOpenGL(1920,1080,OF_FULLSCREEN);
leave it this with the values that were originally there and then in setup


You can actually omit the ofSetWindowShape and just call ofSetFullscreen, and the resolution will be adjusted to your screens resolution

Thank’s Roy !
much clearer now !

1 Like