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.
IndexProgramming Questions & HelpPrograms › dual screen question.
Page Index Toggle Pages: 1
dual screen question. (Read 783 times)
dual screen question.
Feb 13th, 2008, 3:55am
 
Sorry if this question has already been asked and awnserd a lot of times, but I can't find a good solution anywhere.

Anyway, I'm trying to run my processing sketch full screen on my second output, on a beamer. Somehow processing wont 'stick' to my second screen but always jumps back to my main screen when I present it. This might be normal behaviour, but it's not what I need. Does anybody know of a way to make it 'stick' to my second screen.

I've been messing around with the controlP5 library but that hasn't gotten me anywhere yet.

I'm on a Macbook Pro, tiger 1.4.11, Processing 133

Any tips would be very welcome.
Re: dual screen question.
Reply #1 - Feb 13th, 2008, 5:17am
 
The only way I know how to do this is to not use present mode, but instead create an undecorated frame positioned at the pixel location of your second monitor.

Some info here (was written with Processing in Eclipse in mind, but should still apply):

http://itp.nyu.edu/varwiki/BigScreens/FullScreenHacks

Would love to hear if someone knows better though. .
Re: dual screen question.
Reply #2 - Feb 13th, 2008, 2:22pm
 
thanks for the help.
It kind of works but I get some really nasty looking mess at the top of my screen.
Might just be my second screen though.
Will try it out on another screen later, see if that works.

thanks anyway!
Re: dual screen question.
Reply #3 - Feb 13th, 2008, 5:07pm
 
got rid of the mess, just needed to place my screen at -75 for the Y value and... problem solved!

And again, thanks a lot.

Re: dual screen question.
Reply #4 - Feb 15th, 2008, 6:06pm
 
eric_p wrote on Feb 13th, 2008, 5:07pm:
got rid of the mess, just needed to place my screen at -75 for the Y value and... problem solved!

And again, thanks a lot.


-75 on Y and 0 on X of the second or the first screen
I might need to display a Processing program in two screens for an ongoing project and would like to know any issues involved Smiley

Thanks
Re: dual screen question.
Reply #5 - Feb 15th, 2008, 7:14pm
 
-75 on the y and -1024 (the width of the second screen) for the x. I have my 2nd screen positioned on the left, if you have it on the right side you should position the x on the width+1 of your 1st screen.
Re: dual screen question.
Reply #6 - Feb 17th, 2008, 2:08am
 
just in case you want it to be more general, you can use this code snippet

Quote:

private Rectangle[] findScreenDevices() {
 System.out.println(" --- ");
 System.out.println(" Finding graphic devices:");

 GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();

 // gets an array of individual Graphics devices
 // ie if you have two video cards length = 2
 // if you have one normal card and a 4 way multiscreen card length = 5
 GraphicsDevice[] gs = ge.getScreenDevices();
 GraphicsConfiguration[] gc = new GraphicsConfiguration[gs.length];
 Rectangle[] deviceCoords = new Rectangle[gs.length];

 System.out.println("  " + gs.length + " devices found:");

 for (int j = 0; j < gs.length; j++) {
   GraphicsDevice gd = gs[j];
   gc[j] = gd.getDefaultConfiguration();

   System.out.println("    Device " + j + ":");
   System.out.println("     " + gc[j].getBounds());
   deviceCoords[j] = gc[j].getBounds();
 }

 //System.out.println(" --- ");
 return deviceCoords;
}


this will return a list of awt.Rectangles, containing the information about the attached screens/projectors. let's say you have 2 screens and want to get the offsets (where to place the window) and the window-size (the overall-size, covering both monitors), use something like this:

Rectangle unionRect = screenBounds[0].union(screenBounds[1]);


System.out.println("  window size; width:" + unionRect.width + " height:" + unionRect.height);
Re: dual screen question.
Reply #7 - Feb 20th, 2008, 5:18pm
 
ah! thanks, very usefull.
will try it out as soon as I can.
Page Index Toggle Pages: 1