|
BigScreens / FullScreenHacks
Where is the example?The example that does all of this is in the CVS: /home/dts204/BigScreens/examples/ It is called: FullScreenExample FullScreen and OpenGL in EclipseIn Processing, running a sketch fullscreen was easy. All you needed to do is select "Present Mode." The same is true in Eclipse, you can add the "present" argument to the main function:
static public void main(String args[]) {
PApplet.main(new String[] { "--present","packagepath.YourClassName"});
}
First, enable your sketch as an applicationBy default, Processing sketch's run as Applets in Eclipse. In order to run your sketch as an application, you must add a main method:
static public void main(String args[]) {
PApplet.main(new String[] { "packagepath.NameOfSketch"});
}
Once this code is added, you can select RUN AS --> APPLICATION. Dual Monitor FullScreen in default 2D ModeUnfortunately, if you are outputting to two monitors (as we are in this class), the present mode option won't work. Instead, we need a few tricks. Let's look at how this works in Processing's default 2D mode first. In setup(), you need to add one line of code:
public void setup() {
size(1440,900); // (whatever the resolution of your window)
// An undecorated frame
frame.setUndecorated(true);
}
This takes off the menu bar. In draw(), you then position the frame at location (0,0) so that it covers the entire screen.
public void draw() {
// Must set the location each time in draw()
frame.setLocation(0,0);
}
You may have to make sure you turn off the dock (on a Mac) or the taskbar (on Windows). Dual Monitor FullScreen in OPENGL ModeIn OPENGL mode, you need a little bit of code. Why this works is somewhat mysterious to me, but you need to call removeNotify() first, before you can set it to be undecorated. Sometimes you seem to have to do this in other non-OPENGL modes as well.
public void init(){
// to make a frame not displayable, you can
// use frame.removeNotify()
frame.removeNotify();
frame.setUndecorated(true);
// addNotify, here i am not sure if you have
// to add notify again.
frame.addNotify();
super.init();
}
Getting rid of the top menu bar (this is only a problem on a Mac)Once you have followed the above steps, you'll have a nice dual-monitor fullscreen Processing application. There's one problem, that nasty top menu bar is still there. To get rid of this, follow these steps:
|