OMG... this project is semi-dead!!!
I maintained this project for quite a while and it should still be usable for up to processing 1.5.x.

The future however is uncertain, read more about this in the processing forums: https://forum.processing.org/topic/fullscreen-library-development-suspended

-->

FullScreen API For Processing v 0.98.4 (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. It's MIT licensed, 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!

31 Jul 2009, 20:23 sascha thanks for the library! looking forward to seeing progress in OPENGL support! we definately need this! thanks!
21 Sep 2009, 13:47 cristian I am trying to install on a computer with a panasonic digital projector connected. Although FullScreen can read the resolutions and knows the projector is there as screen number 1, I cant get the sketch to displaz on the chosen monitor. It always defaults to the main screen (0) and the second screen is black (1)

Its a real headache for me right now, any help appreciated

// very basic demonstration of the fullscreen api's capabilities
import fullscreen.*;

FullScreen fs;

void setup(){
size(screen.width, screen.height);


// 5 fps
frameRate(5);

// Create the fullscreen object
fs = new FullScreen(this, 1);

// enter fullscreen mode

fs.setResolution(1920,1080);
println (screen.width);
fs.setFullScreen(true);

}
17 Oct 2009, 15:07 hansi @christian - odd... do you have *any* output on the command line?
15 Nov 2009, 18:51 hansi, http://www.superduper.org releasing update next week. for now please try the test-version (at the top of the screen)...
there's won't be many changes, just want to wait a little more if crazy bugs arise.
21 Nov 2009, 03:06 JF There is no bug. Thats nice. Thanks for the lib friend :)

May i ask a question ? :)
-is it possible (not in your lib... im juste asking) to show the applet, only on the second screen?
26 Nov 2009, 16:28 hansi @JF -
yes, you can do something like this:
frame.setLocation( 500, 500 );


@ everyone else... new library is out...(0.98.1)
29 Nov 2009, 23:44 hansi, http://www.superduper.org @everyone:
minor bugfix for mac-version. please upgrade to 0.98.2 if possible!
11 Dec 2009, 11:37 Adam Hi Hansi

Usally I don't have problems when installing new libraries for Processing but your FullScreen API for Processing puzzles me a bit:

First of all Processing wants me to put the fullscreen library in my sketchbook/libraries/ folder... It is placed there...

Secondly I don't seem to have af fullscreen/library folder (?)

I have downloaded the fullscreen-src-0.98.2-package as I'm runing Processing in version 1.0.9...

Cheers
Adam
15 Dec 2009, 07:50 hansi, http://www.superduper.org @Adam:

If you downloaded the latest package from here you should have gotten a .zip file, when you extract it you should see a folder-structure like this:
fullscreen/examples
fullscreen/library
fullscreen/reference
etc.

just the _entire_ folder and move it to /libraries/

if you still have install-trouble just email me directly!
19 Jan 2010, 04:48 Killian Hi Hansi,

Does the Fullscreen library work with OPENGL renderer? I spent almost two hours on trying to get it working. No way!

Setting screen resolution to 800*600 works fine, but afterwards there's nothing but a damned black screen.

size(aWidth, aHeight, OPENGL);
fs = new FullScreen(this);
fs.enter();

Maybe the rendering handle is invalid after changing screen resolution!?


Any suggestions? :-)
Best regards, Killian
19 Jan 2010, 08:45 Hansi, http://www.superduper.org @Killian
Processing version, fullscreen version, operating system, error message... anything???
sorry i need to ask, but my magic skills are kinda low today...
19 Jan 2010, 19:06 Killian Sorry, my bad!

OS: windows vista sp2 64bit
processing: 1.0.7
fullscreen: 0.98

Actually there is no error message. Just a blank black screen.

Usually I code in c++ with opengl, sometimes in pascal & opengl where I always get a handle error when I try to change screen resolution or frame decoration after having initialized OpenGL.

So that's why I got the idea it might be the same problem with !?

Does this help you?
2 Feb 2010, 01:39 sami I'm getting "UnsupportedClassVersionError: A library is using code compiled with an unsupported version of Java"

help?
4 Feb 2010, 20:08 hansi @sami

my bad, i had exported for java6 and you are apparently on java5.
i re-uploaded it!
5 Mar 2010, 12:45 antoine Hi, just downloaded the lib, and still getting the UnsupportedClassVersionError error... (MacOSX)
Did you re-export to java 6 by any chance and by mistake ?
Thanks

This version of Processing only supports libraries and JAR files compiled for Java 1.5.
A library used by this sketch was compiled for Java 1.6 or later,
and needs to be recompiled to be compatible with Java 1.5.
Exception in thread "Animation Thread" java.lang.UnsupportedClassVersionError: Bad version number in .class file
5 Mar 2010, 13:34 antoine Me again,

The "fullscreen-0.98.3.zip" that appears under "all versions" works fine.

But the "fullscreen.zip" that gets downloaded when "Downloald me now !" or "Fullscreen.zip" is pressed does not : compiled under java6.

Thanks !
11 Mar 2010, 15:42 hansi, http://www.superduper.org @antoine

Thanks, glad you figured it out anyways.
Fixed now!

best, h,-
11 Mar 2010, 21:51 Will Is it possible to run one processing sketch fullscreen on one monitor and have another sketch be fullscreen on another monitor?
18 Mar 2010, 20:28 Bill Hsu Thanks for building this! Very useful.

Is there a way to customize the cursor? I usually use cursor(), and it kind of works with the fullscreen API, but the big default arrow cursor flickers in and out.

Bill
23 Mar 2010, 04:48 hansi @Will

There's tons of solutions for this (the easiest to create one giant sketch that stretches across both monitors and then using the softfullscreen mode)


@Bill

I'm sure it's possible to fix this, but i hardly ever change the cursor.
Also I'm not sure it is directly related to this libary... Have you solved this in the mean time?

best, h,-
24 Mar 2010, 17:47 Bill Hsu Hi Hansi, I did a little more research; I'm fairly sure this problem is not related to your library.

I also found a workaround. All the cursor problems go away if I export the sketch to a Java app, and run the Java app instead.

Thanks!
Bill
27 Mar 2010, 11:06 marZ Hi Hansi,
just want to say thank you for your fantastic library! I ve been following your post on processing.org and finaly thanks to your imput i found the solution to my problem after a whole day of looking .
cheers for this!!!!!
30 Mar 2010, 14:21 sylvain I have this error (linux ubuntu 8.10) when i try to use the opengl rendering (2D) with your library
Exception in thread "Animation Thread" javax.media.opengl.GLException: Unable to create OpenGL context
4 Apr 2010, 19:35 Lord_Sonic thank you for this! it works just fine!
5 Apr 2010, 22:16 john open gl support would be very nice... i need it too.
gogogo hansi u make a great job! =)
5 Apr 2010, 22:54 ann How do you include the libjAppleMenuBar.jnilib in eclipse?

see ya, ann
6 Apr 2010, 01:15 hansi, http://www.superduper.org @sylvain: have you checked whether you can run a normal opengl sketch?
that doesn't sound like your problem is caused by this library.

@john: working on it...

@ann: is that you, ann? :) make a folder "lib" and copy the jnilib into it. Then edit your run configuration. Add this to the jvm-parameters:
-Djava.library.path=lib
8 Apr 2010, 12:20 ann Yeah hansi, thanks for the help. yes we are a team, which work on a processing project. we forget to inlcude the *jogl.jnilibs* into the jvm path, now opengl is working with your libs :)
13 Apr 2010, 18:04 thatbrock, http://brockcraft.com Hiya, excellent library, thanks! I do have one question. I'd like to get the app to display only on one of my 2 screens. @JF asked this.

To @JF, you wrote:

yes, you can do something like this:
frame.setLocation( 500, 500 );

It tried this, but still get a black screen on screen 0 (my fullscreen is set to 1). Can you give a short example of this perhaps? Thanks!
(Leopard, P1.1, fs v 0.98.4)
14 Apr 2010, 12:12 hansi @thatbrock:
working on it!
http://github.com/kritzikratzi/fullscreen-p5/issues#issue/15
18 Apr 2010, 02:18 cr0ybot Is there a list of "accepted" resolutions? I tried setting my screen size to 768x480 because my monitor has an aspect ratio of 16:10. My output told me "Display mode not supported: 768x480." It did however go into semi-fullscreen, just with a large black frame. I need it to go full-fullscreen, though.

Great job taking the initiative to create such a necessary library, by the way!

-cr0ybot
22 Apr 2010, 15:39 cr0ybot Apparently you just need to use a resolution that is already present on the computer in the display settings. So never mind my previous comment, except for the "great job" part!
13 May 2010, 21:19 bruno Thanks for this library; it's been useful over and over again.

I have two questions related to OpenGL. I have been using it with SoftFullscreen, and for most cases, it works great, but (1) if I set the OpenGL fog in setup(), the fog won't work unless I call:

gl.glFogi(GL.GL_FOG_MODE, GL.GL_LINEAR);
gl.glFogf(GL.GL_FOG_START, 550.0f);
gl.glFogf(GL.GL_FOG_END, 950.0f);
gl.glEnable(GL.GL_FOG);

in draw() for each frame as well, as if those values were reset by your library. Not a big problem really.

(2) This one is a bit more annoying, still in OpenGL with SoftFullScreen, if I render objects (e.g. using text()) at the right edge of the applet, I get artifacts on the left edge. This is not true the other way around, rendering on the left edge renders fine.

Any idea?
13 May 2010, 21:56 bruno update for previous post:

forget problem (2), after too much time trying to solve it in software, i found out that the screen I was using was not adjusted properly.
26 May 2010, 00:03 stev.ie, http://stev.ie/ Hi there,

Very nice lib! Thanks for providing it! :)

I'm trying to set full screen resolution to the screen.width and screen.height but it doesn't seem to be supported, my sketch just defaults to the sketch size, i.e.

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

// 5 fps
frameRate(5);

// Create the fullscreen object
fs = new FullScreen(this);

fs.setResolution(screen.width, screen.height);

// enter fullscreen mode
fs.enter();
}

Any suggestions for making this work?
26 May 2010, 12:15 hansi, http://www.superduper.org @sev.ie
http://github.com/kritzikratzi/fullscreen-p5/issues/closed#issue/16

as i said in the bug tracker, unfortunately not a bug but a limitation.
26 May 2010, 12:19 hansi @cryobot:
please see lookup the static functions like FullScreen.getResolutions()
http://superduper.org/processing/fullscreen_api/reference/fullscreen/FullScreen.html

@bruno
have you tried putting the fog-initalizer inside the displayChanged function? like so:

public void displayChanged(){
// init fog here!
}
27 May 2010, 12:27 Joakn First of all thank you for the library!
I've a problem, I have four screens and when y run the sketch, which size is 1360*4 x 768, it only works in the principal screen... (for a second works in all, but with the window, then only in the nº 1)

The sketch:

import fullscreen.*;

SoftFullScreen fs;

void setup(){
// set size to 640x480
size(1360*4, 768);

// 5 fps
frameRate(5);

// Create the fullscreen object
fs = new SoftFullScreen(this);

// enter fullscreen mode
fs.enter();
}

Thanks



28 Jul 2010, 02:38 navax I cant set double screen sample on MAC OSX (10.6.4). Windows 7 works fine.
4 Aug 2010, 01:22 DST, http://dstgames.com I have a flatscreen with a resolution of 1600 x 900. My sketch is 800 x 600. It scales to match my screen aspect ratio, giving me a 'stretched' app. My nvidia control panel is set to keep aspect ratio: it works for all other programs i've used so far, such as games made with Game Editor.

Is there any way to force aspect ratio on it? Black spaces on the sides would be fine with me.
18 Sep 2010, 02:36 s4l4x, http://decathexis.com I'm having trouble getting this working under eclipse. I tried the above mentioned VM arguments as well as setting the Native Library folder for the fullscreen.jar. I get an exception no matter what I try:

Exception in thread "Animation Thread" java.lang.NullPointerException
at fullscreen.FullScreen.(FullScreen.java:93)

Can someone post a simple example which works under eclipse? Thanks!!
20 Sep 2010, 21:20 s4l4x, http://decathexis.com Ahh, missed the Warnings & Limitation BELOW the comments!! Must run as an application! Sorry for the noise. Perhaps consider moving Warnings & Limitations above the comments. Thanks!
8 Nov 2010, 21:16 Count Zim Superrr! Danke Hansi.
15 Nov 2010, 16:47 antoine Hi again,
I've got an error when using the SoftFullscreen here, at runtime :

java.lang.UnsatisfiedLinkError: /Users/antoine/Documents/Processing/libraries/fullscreen/library/libjAppleMenuBar.jnilib: no suitable image found. Did find: /Users/antoine/Documents/Processing/libraries/fullscreen/library/libjAppleMenuBar.jnilib: unknown required load command 0x80000022
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1824)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1741)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:993)
at japplemenubar.JAppleMenuBar.(JAppleMenuBar.java:33)
at fullscreen.SoftFullScreen.setFullScreenImpl(SoftFullScreen.java:200)
at fullscreen.SoftFullScreen.access$000(SoftFullScreen.java:55)
at fullscreen.SoftFullScreen$2.action(SoftFullScreen.java:182)
at fullscreen.FullScreenBase$DelayedAction.post(FullScreenBase.java:219)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at processing.core.PApplet$RegisteredMethods.handle(PApplet.java:851)
at processing.core.PApplet$RegisteredMethods.handle(PApplet.java:844)
at processing.core.PApplet.handleDraw(PApplet.java:1641)
at processing.core.PApplet.run(PApplet.java:1503)
at java.lang.Thread.run(Thread.java:655)

Then all calls to the SoftFullScreen object give a:
java.lang.NoClassDefFoundError

This is Mac 10.5.8 w/ java 1.5.0_26

Any idea why ?
Thanks
15 Nov 2010, 19:29 hansi, http://www.superduper.org @antoine
this is fixed for 0.98.5 which is already available on github, i'll release a proper fix asap...
24 Dec 2010, 13:44 Romée Hi Hansi,
BIG BIG Thank's for this, but it doesn't work with me :) ...

here is my sketch, it's a random slide show

/**
Brainwashing
Correction: romée by basile
*/

import fullscreen.*;
FullScreen fs;
PImage img;
String[] files;
int timer;
float a ;
int fragNumber;


void setup() {
size(1300,760);
frameRate(5);

fs = new FullScreen(this);

fs.enter();

float a = random(0,1238);// a est une valeur au hasard comprise entre les deux valeurs données (n'apelle pas tes images "0001" mais "1");
int fragNumber = int (a);//fragNumber est l'arrondi de a (10,55 --> 11)


img = loadImage("pic_" + fragNumber +".jpg");
println(fragNumber);
timer=0;
}


void draw() {
background(255);
if(timer==0)
{
smooth();
imageMode(CENTER);
image(img,650,380);//Si tu veux leur donner à toute une taille commune (les adapter à la fen^tre par ex:
// il te suffit de mettre image(img,0,0,largeur,hauteur);


}
else if(timer==1)
{

a = random(0,1238);
int fragNumberPlus=int (a);//fragNumberPlus est l'image qui charge pendant ce temps (une autre épreuve de "a")
img = loadImage("pic_" + fragNumberPlus +".jpg");


println(fragNumberPlus);
delay(10); //this decides how long an image should be displayed
}
timer=(timer+1)%2;
}



I installed your library well, "fullscreen" appears in "Import libraries" of the processing "skectch" menu.
When I run my sketch, nothing happen for 20 seconds and then:
Java error:


Exception in thread "Thread-13" java.lang.OutOfMemoryError: Java heap space
at antlr.ANTLRStringBuffer.append(ANTLRStringBuffer.java:36)
at antlr.CharScanner.append(CharScanner.java:64)
at antlr.CharScanner.consume(CharScanner.java:82)
at antlr.CharScanner.match(CharScanner.java:205)
at processing.app.preproc.PdeLexer.mML_COMMENT(PdeLexer.java:538)
at processing.app.preproc.PdeLexer.nextToken(PdeLexer.java:249)
at antlr.TokenStreamHiddenTokenFilter.consume(TokenStreamHiddenTokenFilter.java:38)
at antlr.TokenStreamCopyingHiddenTokenFilter.consumeFirst(TokenStreamCopyingHiddenTokenFilter.java:134)
at antlr.TokenStreamCopyingHiddenTokenFilter.nextToken(TokenStreamCopyingHiddenTokenFilter.java:152)
at antlr.TokenBuffer.fill(TokenBuffer.java:69)
at antlr.TokenBuffer.LA(TokenBuffer.java:80)
at antlr.LLkParser.LA(LLkParser.java:52)
at processing.app.preproc.PdeRecognizer.pdeProgram(PdeRecognizer.java:63)
at processing.app.preproc.PdePreprocessor.write(PdePreprocessor.java:337)
at processing.app.Sketch.preprocess(Sketch.java:1271)
at processing.app.Sketch.preprocess(Sketch.java:1204)
at processing.app.Sketch.build(Sketch.java:1590)
at processing.app.Sketch.build(Sketch.java:1575)
at processing.app.Editor$DefaultRunHandler.run(Editor.java:1656)
at java.lang.Thread.run(Thread.java:680)


This is what I got:

Processing 1.1
MacBook 2,26Ghz
2 GO memory
OS X 10.6.5.

Any Clue?

Sorry, very long mail!!!!!

MERRYYYYYY CCHHRIIISTMAAAAASSSSSS!!!!!!!!!
19 Jan 2011, 23:28 Morris I am using dual screens, and am running my sketch in fullscreen. However, since the background turns black, I want to change the location of the sketch (I dont mind the second monitor to be all black). The fullscreen mode automatically centeres the sketch. How can I move the sketch to the left?
19 Jan 2011, 23:30 Morris I am using dual screens, and am running my sketch in fullscreen. However, since the background turns black, I want to change the location of the sketch (I dont mind the second monitor to be all black). The fullscreen mode automatically centeres the sketch. How can I move the sketch to the left?
19 Jan 2011, 23:57 hansi, http://www.superduper.org with a simple solution: unfortunately you can't
with a nasty solution: make your sketch twice as big and paint the right half black
with a proper solution: fetch/fork https://github.com/kritzikratzi/fullscreen-p5/ , then according to what you're using change here: https://github.com/kritzikratzi/fullscreen-p5/blob/master/src/fullscreen/SoftFullScreen.java#L212 and/or here: https://github.com/kritzikratzi/fullscreen-p5/blob/master/src/fullscreen/FullScreen.java#L167
19 Jan 2011, 23:59 hansi, http://www.superduper.org @everyone:
sorry i haven't been maintaining this library very well in the past year. i still find it handy to have this functionality every now and then, but don't really have the time to maintain it well.

if you'd like to fetch/fork/update you're more than welcome.
20 Jan 2011, 15:52 keebOo Hi, using with openGL on mac os x give me this error (dual screen, fullscreen e softfullscreen mode):
Frame buffer is incomplete (GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT)

...se the comments above about OpneGl and lib to add.... but...

anyone could help me?

thanks.
3 Mar 2011, 17:54 Nick93 I downloaded the file and extracted it to anywhere it's possible, but it doesn't work.

There is always this message:
"Note that release 1.0, libraries must be installed in a folder named 'libraries' inside the 'sketchbook' folder.
"

Please help me, I become crazy because of this^^






$img = imagecreate( 100, 35 ); $white = imagecolorallocate( $img, 255, 255, 255 ); $black = imagecolorallocate( $img, 0, 0, 0 ); imagefill( $img, $white, 0, 0 ); imagettftext( $img, 22, 0, 15, 35, $black, realpath( "f_bm_neco.ttf" ), $_SESSION["ANTI_SPAM"] ); ob_start(); imagepng( $img ); $content = ob_get_contents(); ob_end_clean(); echo ""; ?>




Warnings & Limitations

  • Only works for applications (not for applets)
  • This size of the sketch can not be scaled to screen size in fullscreen mode
  • Fonts are sometimes corrupted, use this as a workaround.
  • A list of bugs can be found here.

  • The ESC key exists the application, not fullscreen mode
  • It seems not every implementation of Java on Linux gives you proper fullscreen support, you might not be able to switch resolution
  • This package conflicts with processings "present" option

Thanks!

Thanks to github.com for providing a source repository 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 github project page at http://github.com/kritzikratzi/fullscreen-p5/. You'll also find git access and a wiki there.

My Amazon.com Wish List hansi raber, www.superduper.org Last updated: Apr 01, 2014