Full screen and max resolution on any monitor


Is there a way to make your program full screen AND be automatically configured to fit the largest possible resolution for any monitor it will run on?


I’ve only tried it one my Mac, so unsure if it would automatically resize to other screens, but try this. Before you call setupOpenGL() in main.cpp use:

CGRect thisMonitorArea = CGDisplayBounds(CGMainDisplayID());  
int thisWidth = CGRectGetWidth(thisMonitorArea);  
int thisHeight = CGRectGetHeight(thisMonitorArea);  

then you can pass those values in:

ofAppGlutWindow window;  
ofSetupOpenGL(&window, thisWidth ,thisHeight, OF_FULLSCREEN);  

Again, it’s only been tested on one screen and it might just take my resolution on compile - ultimately proving worthless to you! :lol: I did a quick google and it seems you can use GetSystemMetrics() for Windows but I wouldn’t be able to use that. Hope this helps somehow.

Thanks! Works great. The only thing I changed was OF_FULLSCREEN to OF_WINDOW.