FullScreenHacks
Search:
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 Eclipse

In 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 application

By 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 Mode

Unfortunately, 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 Mode

In 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:

  1. Export to application. In Eclipse, right-click on your main class (i.e. the Java class that extends PApplet), and select: EXPORT. Under "OTHER" select "Mac OS X Application Bundle." Under JVM Options, make sure you select Java 1.4+ (not 1.4*). Under "Destination" pick a folder. Click finish. Go ahead and find the application. You should be able to double-click and run it.
  2. Once you are sure it is working, go and download pList Editor Pro.
  3. Now, find your application again. Right-click on it and select "Show Package Contents." In the "Contents" folder there should be a file called info.plist. This is the file you want to edit with pListEditor. Right-click on info.plist and select "Open With pList Editor."
  4. Once you had the file open, you will want to "Add a new child." Click the "New Child" button on the top left. Enter the child with the following info:
    • Name: LSUIPresentationMode
    • Class: Number
    • Value: 4
  5. Save the info.plist file and run the application again. You'll see the menu bar has disappeared!
Search
  Page last modified on October 18, 2009, at 09:22 PM