We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProcessing DevelopmentLibraries,  Tool Development › fullscreen api, here u go!
Pages: 1 2 3 4 
fullscreen api, here u go! (Read 39277 times)
Re: fullscreen api, here u go!
Reply #15 - Oct 25th, 2007, 4:55pm
 
No real technical updates, but I changed the fullscreen api to be a proper library.

That means you won't have to copy paste a bunch of files anymore.

It should be very easy to change your code, here's a working example:

import fullscreen.*;

FullScreen fs;

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

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


void draw(){
 // draw something
}


As always:
http://www.superduper.org/processing/fullscreen_api/


I still wasn't able to properly handle opengl issues, as well as having a sketch span over multiple monitors. Sorry for that. If anybody has an idea how to solve this please contact me!
Re: fullscreen api, here u go!
Reply #16 - Oct 27th, 2007, 6:27pm
 
I have tried to install and load the fullscreen API in my code but no luck. I am sure that the the fullscreen.jar file is located at the right location and processing says it cannot find it. Any idea?

Processing says: cannot find fullscreen

/tmp/build14130.tmp/Temporary_8930_6710.java:1:11
8:1:127: Semantic Error: You need to modify your classpath

Strange isn't it?

I have tried with the following code:

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);
 fill(255, 0, 0);

 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
   );
 }
}


Re: fullscreen api, here u go!
Reply #17 - Oct 27th, 2007, 6:35pm
 
OK .. I have now managed to load (I guess) the fullscreen API in my sketch. This is exactly the code I have inserted:

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);
 fill(255, 0, 0);

 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
   );
 }
}

And I now get the following error:


/tmp/build26493.tmp/Temporary_2277_5309.java:3:1:3:10: Semantic Error: Found package ".FullScreen" when a type was expected.

/tmp/build26493.tmp/Temporary_2277_5309.java:13:12:13:21: Semantic Error: Found package ".FullScreen" when a type was expected.

apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NullPointerException
java.lang.NullPointerException
at processing.app.Editor.handleStop(Editor.java:1196)
at processing.app.EditorToolbar.mousePressed(EditorToolbar.java:320)
at java.awt.Component.processMouseEvent(Component.java:5163)
at java.awt.Component.processEvent(Component.java:4963)
at java.awt.Container.processEvent(Container.java:1613)
at java.awt.Component.dispatchEventImpl(Component.java:3681)
at java.awt.Container.dispatchEventImpl(Container.java:1671)
at java.awt.Component.dispatchEvent(Component.java:3543)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3527)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3239)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3172)
at java.awt.Container.dispatchEventImpl(Container.java:1657)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3543)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:480)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:2
34)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:184
)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:178)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:170)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)


Why oh why? Thanks a lot for your help.
Re: fullscreen api, here u go!
Reply #18 - Nov 9th, 2007, 8:36pm
 
Could you provide a way to look at a list of available graphics modes/resolutions, so my program can be resolution-independent?
Re: fullscreen api, here u go!
Reply #19 - Nov 10th, 2007, 1:08am
 
diordna wrote on Nov 9th, 2007, 8:36pm:
Could you provide a way to look at a list of available graphics modes/resolutions, so my program can be resolution-independent

good idea, i'll definitely include this in the next version.

hansi.
Re: fullscreen api, here u go!
Reply #20 - Apr 10th, 2008, 1:11am
 
Nice library!Thank you!
I tried it on Windows XP, using P3D, works great so far.
Re: fullscreen api, here u go!
Reply #21 - Apr 27th, 2008, 1:02am
 
Works with OPENGL as well!(windows XP)
But is there any way how to use this library with second screen(projector)? It works, if I set the 'projector screen' as the copy of the desktop, but it of course takes over both screens(which isn't that useful in some situations as you can probably imagine ). When the projector  is set as second monitor, it places the fullscreen on the computer and my working desktop on the projector screen (which is even less useful than the first option ). Maybe someone knows how to solve this? Thank you Smiley
Re: fullscreen api, here u go!
Reply #22 - Apr 27th, 2008, 9:57am
 
marura wrote on Apr 27th, 2008, 1:02am:
Works with OPENGL as well!(windows XP)
But is there any way how to use this library with second screen(projector) It works, if I set the 'projector screen' as the copy of the desktop, but it of course takes over both screens(which isn't that useful in some situations as you can probably imagine ). When the projector  is set as second monitor, it places the fullscreen on the computer and my working desktop on the projector screen (which is even less useful than the first option ). Maybe someone knows how to solve this Thank you Smiley


hey!

unfortunately there is no way yet to use it with both monitors.
you can do two things:
- wait for the next version i'm working on, but that could take quite a while
- if you have some java skills you can modify the source files of the fullscreen api so it would accept a parameter for screen number (now it always uses screen 1), then you could have two sketches running in parallel, one on screen1, one on screen2.



best, hansi.
Re: fullscreen api, here u go!
Reply #23 - Apr 27th, 2008, 3:01pm
 
hi,
maybe this code snippet may help till the next version of fullscreen api is out. it sets the frame to undecorated, then set the position of the frame to your preferred location in setup()

Code:

// overwrite PApplet's init method
// to set the frame to undecorated=true
public void init() {
frame.setUndecorated(true);
super.init();
}

void setup() {
// set the siz of the sketch to the
// screen resolution of the second screen
size(1024,768,OPENGL);
// set the location of the undecorated frame
// in this example to the right of screen 1
frame.setLocation(screen.width, 0);
}

void draw() {
background(0);
}
Re: fullscreen api, here u go!
Reply #24 - Apr 27th, 2008, 10:56pm
 
Thank you!
Sojamo's way works great for me (as I wasn't able to change the  sourcode(myJavaKnowledge=crap)and couldn't wait for update of the fullscreen API Smiley
Re: fullscreen api, here u go!
Reply #25 - May 8th, 2008, 8:46pm
 
Hi,

I tried Sojamo's code in a Mac (PowerBook).
The compiler throws the exception:

java.awt.IllegalComponentStateException: The frame is displayable.

Can you give me some hint?

Thanks,
L.
Re: fullscreen api, here u go!
Reply #26 - May 8th, 2008, 8:52pm
 
laliki wrote on May 8th, 2008, 8:46pm:
Hi,
java.awt.IllegalComponentStateException: The frame is displayable.
Can you give me some hint

You can't turn on/off window decorations while the frame is visible.
Try this:
frame.dispose();
frame.setUndecorated( true );
frame.setVisible( true );

One warning: On macos you won't get the expected behaviour, because the menubar will always be on top.
improvement around the corner
Reply #27 - May 13th, 2008, 11:58pm
 
hey all!

i'm almost finished with something i call the "soft" fullscreen mode. it'll allow you to have dualscreen sketches, also it's a less invasive way of switching to fullscreen.

if you have two screens and you'd like to test this please send me your email adress as a message in the forums, i'll then send you the files.

all the best and stay tuned, it won't be a long wait.

hansi.
Re: fullscreen api, here u go!
Reply #28 - May 14th, 2008, 8:08am
 
Hi,

I'd like to test "soft" fullscreen mode.
I'm Mac.
My e-mail: barriere@gmail.com

L.
Re: fullscreen api, here u go!
Reply #29 - May 17th, 2008, 2:13am
 
Try stick this in after the size(w,h); statement, it gets rid of the menubar:

/* full screen */
 frame.dispose();
 GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
 GraphicsDevice displayDevice=ge.getDefaultScreenDevice();
 frame.setUndecorated(true);
 displayDevice.setFullScreenWindow(frame);
 Dimension fullscreen = frame.getSize();
 this.setBounds((fullscreen.width - this.width) / 2,
 (fullscreen.height - this.height) / 2,
 this.width, this.height);
 /* end full screen */


Example usage:


void setup()
{

 size(1280,800);

 /* full screen */
 frame.dispose();
 GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
 GraphicsDevice displayDevice=ge.getDefaultScreenDevice();
 frame.setUndecorated(true);
 displayDevice.setFullScreenWindow(frame);
 Dimension fullscreen = frame.getSize();
 this.setBounds((fullscreen.width - this.width) / 2,
 (fullscreen.height - this.height) / 2,
 this.width, this.height);
 /* end full screen */
}

Its a hack and probably breaks down with more than one screen. All it does is shut down the current frame and restart it up with fullscreen settings. The code is mostly copied from Processing's present mode.
Pages: 1 2 3 4