Simply setting project or stage dimensions

Ok, gone thru the intro tutorials, have done a search, but I need to

  1. set up a custom project size (1920x1080) and also
  2. optionally set the project to fullscreen.

Here’s a related question

can anyone help me with either of these?

1 Like

Hi,

If you look at main.cpp you’ll have the option to set an initial size, launch straight into fullscreen, etc.

To onKeyPressed I usually add a:

if( key == 'f' )
{
		ofToggleFullscreen();
}

to toggle the project fullscreen and back to a window at will. Then in windowResized I re-allocate any FBOs etc that I might have at screen size.

There is a ofGetScreenWidth/Height as well to get the size of the screen.

1 Like

Great, thanks!

You can set your initial values of the screen size in the main.cpp file.

e.g.


#include "ofApp.h"

int main()
{
	ofSetupOpenGL(1920, 1080, OF_WINDOW); // Not full screen
	ofRunApp(new ofApp());
}

#include "ofApp.h"

int main()
{
	ofSetupOpenGL(1920, 1080, OF_FULLSCREEN); // IS full screen
	ofRunApp(new ofApp());
}

To modify the size of your app after it has launched, you can use ofSetWindowShape(1920, 1080); (or whatever size you like).

See @hahakid’s tip for toggling full screen.

Other helpful functions for window size and position manipulation:

http://openframeworks.cc/documentation/application/ofAppRunner.html