FullScreen API For Processing v 0.97 (changes)

Download!

Hey there! I am a library for Processing for better fullscreen support. Download me now!  → all versions
p.s. i do crash sometimes. if you think you can help just send me a message in the processing discourse section.


Javadocs

Online javadoc reference here.


Short Reference

fs = new FullScreen(this)
Creates a new fullscreen object.
fs = new SoftFullScreen(this)
Will create a big window without frames that overlays the screen. This will allow you create a sketch that is dual screen. However, be aware that you'll have to disable screensaver, app notifications and active corners yourself! Also you won't be able to change the resolution.

fs.enter() / fs.leave()
Enters / leaves fullscreen mode.
fs.setResolution(x, y)
Changes the resolution if you are in fullscreen mode. If not it memorizes the resolution and sets it the next time you enter fullscreen mode. By default it will try to use the sketch size as resolution.
fs.setShortcutsEnabled(true/false)
Enables/disables keyboard shortcuts.

To enter/leave fullscreen mode
Windows: Alt+Enter, Ctrl+F
Linux: Ctrl+F
OS X: ⌘+F
ESC: leave fullscreen / exit application

Shortcuts are enabled by default!

Install

Download the file fullscreen.zip and extract it to <processing-sketches>/libraries/.

You can also download fullscreen-src.zip if you wanna take a look at the sourcecode. Remember: It's GPL, if you make usefull changes let the world know about it!


Example Usage

import fullscreen.*; 

FullScreen fs; 

void setup(){
  // set size to 640x480
  size(640, 480);
  
  // 5 fps
  frameRate(5);

  // Create the fullscreen object
  fs = new FullScreen(this); 
  
  // enter fullscreen mode
  fs.enter(); 
}


void draw(){
  background(0);
  
  // Do your fancy drawing here...
  for(int i = 0; i < 10; i++){
    fill(
      random(255),
      random(255),
      random(255)
    );

    rect(
      i*10, i*10,
      width - i*20, height - i*20
    ); 
  }
}


Feedback

Does the fullscreen api sometimes make your sketch crash? Do you wish it'd be easier to use? Any other annoying things you noticed? Suggestions? Or are you just happy? Leave a message!

13 May 2008, 23:45 Hansi Uh, we have a new version.
8 Oct 2008, 03:10 hansi, http://www.superduper.org I hate fighting spam bots.
9 Oct 2008, 20:07 blausand, http://www.silvertree.de Fine Done!
How far is the implementation of the parameter for setting the correct Adapter#?
I have one monitor switcheing the resolution while the other one is displaying the app...

[OT] Do you prefer to discuss this on the processing forum?
12 Oct 2008, 15:00 Karl Hi!

Is there any chance you could upload the JNI hide_menu native library code to the repository? I've been searching for a way to hide the Mac menu bar in Java for the longest time!

Thanks in advance!

Karl
13 Oct 2008, 15:39 Hansi, http://www.superduper.org @blausand: there is an option to specify the screen number
fs = new FullScreen( this, screenNr );

however, there are a bunch of problems with this: first the code isn't tested, cause i'm on a single screen environment. second afaik most operating systems make the second screen go blank if one of them switches to fullscreen. you might be able to get around this by using two fullscreen-windows instead of just one, something like

FullScreen fs1, fs2;

void setup(){
size( ... );
fs1 = new FullScreen( this, 0 ); // use monitor 0
new ExampleFrame(); // create second sketch
}

void draw(){ ... }

void displayChanged(){
fs2.setFullScreen( fs1.isFullScreen() );
}


// code for the second applet
public class ExampleFrame extends Frame {

public ExampleFrame() {
super("Embedded PApplet");

setLayout(new BorderLayout());
PApplet embed = new Embedded();
add(embed, BorderLayout.CENTER);

embed.init();
}
}

public class Embedded extends PApplet {
public void setup() {
size(..);
fs2 = new FullScreen( this, 1 ); // 1
}

public void draw() {
}

public void displayChanged(){
fs1.setFullScreen( fs2.isFullScreen() );
}
}


this is a nasty workaround, but it *might* work.
13 Oct 2008, 15:47 Hansi, http://www.superduper.org @Karl:
Hey! I never managed to get it to work in eclipse, but download the xcode source from here:
http://www.superduper.org/processing/fullscreen_api/versions/hide_menubar.zip

hope it compiles :)
10 Nov 2008, 20:33 Celine I am running a fullscreen sketch and using the noCursor() command in my Draw() routine, but I still occasionally get a system cursor showing up. Help!

More info: I am using Processing 0135 Beta, the FullScreen .96 library and the ProControll library. I have 6 USB mice attached and am getting multiple spatial input streams through ProControll.

Thanks to anyone who can help...
10 Nov 2008, 21:03 Celine To add to above message, I am also getting the following when I run my sketch:
FullScreen API: Display mode not supported: 1440x980
Although 1440x980 is the resolution of my MacBook Pro display.
13 Nov 2008, 21:41 Hansi, http://www.superduper.org @Celine
Hey there!

For the cursor, try this code from here to create a transparent cursor.
http://www.rgagnon.com/javadetails/java-0440.html
Then do a setCursor( transparentCursor ) inside draw.
I haven't looked into why this happens with processing's noCursor(), but I remember having the same issues.

For the display mode: My macbook pro has 1440x900, but assuming you're have one with a different resolution this is odd. Does it work for you to change to other resolutions? (Say 800x600)


all the best,
hansi.
14 Nov 2008, 07:13 Mike The cursor problem occurs when the mouse is at the very top of the screen. It seems that there are a few pixels of space above the active java window that reveal the cursor again. Is there a way to use some of the osx-java scripts to help this?
http://developer.apple.com/documentation/Java/Conceptual/JavaPropVMInfoRef/Articles/JavaSystemProperties.html
ex: apple.awt.fullscreenhidecursor
14 Nov 2008, 18:27 Mike It seems that the java commands for removing decorations and going full screen leave an invisible space at the top of the screen when running. I changed the background color to gray and noticed a slightly darker gray area at the top. When I rolled over it the mouse would appear and then disappear when brought back into the active space. So, is there a way to completely get rid of the phantom app bar at the top. I've looked at alot of documentation regarding frame.setLocation and frame.setUndecorated. Any help would be great.
23 Nov 2008, 13:24 Hansi, http://www.superduper.org @Mike:

Sorry, still don't have time to look into this, hopefuly next week...
2 Feb 2009, 21:57 Mtf Hi there. Great API, thanks for your hard work!

Unfortunately, I'm also having trouble displaying a particular resolution, 1366x768. I get this error:

FullScreen API: Display mode not supported: 1366x768

Other resolutions seem to work fine though. (640x480, 1680x1050 for example.) Any ideas?

Thanks!
18 Feb 2009, 17:24 hansi, http://www.superduper.org @mtf - can you run the "list_resolutions" examples included in the download and post the console output here? (open processing, then from the menu choose file > sketchbook > libraries > fullscreen > examples > d_list_resolutions)
2 Apr 2009, 17:05 Akito Hi Hansi,

I am trying to set up fullscreen under eclipse environment and I am keep getting this error message:

Exception in thread "Animation Thread" java.lang.NullPointerException
at fullscreen.FullScreen.(Unknown Source)
at fullscreen.FullScreen.(Unknown Source)

I read one of the threads here:
http://processing.org/discourse/yabb2/YaBB.pl?num=1150213949/53

and you suggest that fullscreen needs to be up-to-date corresponding to processing version. But I don't think the error I am getting is related to the version because fullscreen runs fine within processing application. When I try to use fullscreen in eclipse environment then I get this problem.

So my question is, is there a specific set up I need to have in order to use fullscreen under eclipse? Are there any jar files that needs to be included with fullscreen? Any suggestion is appreciated. Thank you for your time.

~Akito
3 Apr 2009, 04:51 Akito Sorry for the ealier post. I didn't read the limitations carefully. But now I understand that fullscreen only works for applications (not for applets).
5 Apr 2009, 23:13 hansi Hey Akito!

I'm very interessted in tracking down this error...
Can you email me? (my address is at the bottom of the page)...


best, hansi,-
30 Apr 2009, 15:50 Jan, http://www.freeduino.de i know it's a very noob question, but i can't get it installed. don't understand the folder logic? can anyone point me to some help how to better unterstand how to place the library file in the folder structure.
10 May 2009, 18:26 Hansi Raber @Jan

Download the fullscreen.zip file from above, when you extract it you should get a folder "fullscreen".

Now locate your sketchbook folder (usually $home/Documents/Processing). Inside that folder you should find a folder called "libraries". If it doesn't exist just create it. Then drop the fullscreen folder from above inside the libraries folder. Done :)
It's basically the same for any library you want to install....
8 Jun 2009, 05:03 Keston, http://audiocookbook.org/ Hi Hansi. Great API, thanks! One question, on OSX Is there a way for SoftFullScreen(this) to display the window on a second monitor that is not the primary monitor (does not have the menu bar and dock active)? When I enter full screen using this method it reverts to the primary monitor regardless of where the application window was active. Thanks!
9 Jun 2009, 18:26 Iching, http://tao.xs4all.nl Hi Hansi, the fullscreen library is giving trouble in P5 1.0.4. and 1.0.5. When installed it gives 'no jogl in java.library.path' errors. Even in code where you don't use the library at all ( not imported ). Remove it from the libraries directory and everything works fine again. No problem with P5 1.0.3.
Thnx








Warnings & Limitations

  • Only works for applications (not for applets)
  • This package conflicts with processings "present" option
  • The ESC key exists the application, not fullscreen mode
  • This size of the sketch can not be scaled to screen size in fullscreen mode
  • Requires Java 1.4 to work
  • It seems not every implementation of Java on Linux gives you proper fullscreen support, you might not be able to switch resolution
  • Some people report random crashes, if you get on of those please get in touch with me!

Thanks!

Thanks to gna.org for hosting for this project and a big thanks to everybody who sent problems and suggestions to me!

Developers welcome!

If you're interrested in helping develop this api further or you wanna help testing new experimental versions please visit the gna project page at https://gna.org/projects/fullscreen-p5/. You'll also find svn access there.

My Amazon.com Wish List hansi raber, www.superduper.org Last change: mar 13, 2009.