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 › Twou windowed sketch with a tiny monitor screen.
Page Index Toggle Pages: 1
Twou windowed sketch with a tiny monitor screen. (Read 1039 times)
Twou windowed sketch with a tiny monitor screen.
Sep 1st, 2009, 8:44pm
 
I'm making a two windowed app that opens a second window for a control pannel. This is done trhough ControlP5 Library ( http://www.sojamo.de/libraries/controlP5/ ).

I just wanted to know if anyone knows how to make a duplicate of the sketch window and put it in the control panel but scaled down, like a tiny monitor of what's going on the big screens.

The aim of the app is making a live visuals environment that's why it has a secondary window with a control pannel.

Thanks in advance for any help Smiley

Source code is HUGE that's why I didn't put any of it in here Tongue
Re: Twou windowed sketch with a tiny monitor screen.
Reply #1 - Sep 1st, 2009, 10:39pm
 
Think this is what you're looking for
http://processing.org/discourse/yabb2/num_1237399186.html#1
Re: Twou windowed sketch with a tiny monitor screen.
Reply #2 - Sep 4th, 2009, 12:28am
 
thanks!

Pretty much yes. But, through the night, I found another, more code economic than this, which I think you may finde hady:

After doing all drawings in the sketch as you usually do put this in the end of the draw() loop:

Quote:
  loadPixels();
  yourPGraphicsBuffer.beginDraw();
  for (int i = 0; i < this.pixels.length; i ++) {
    yourPGraphicsBuffer.pixels[i] = this.pixels[i];
  }
  yourPGraphicsBuffer.endDraw();
  updatePixels();



Then you use the image where you need it Smiley (much easier to use when usin ControlP5 [at the sad expense of processor cycles Sad ])
Re: Twou windowed sketch with a tiny monitor screen.
Reply #3 - Sep 4th, 2009, 1:47am
 
You don't scale your image, and you don't need begin/endDraw before writing pixels[]. And the updatePixels() call is useless as you don't change this.pixels[] (which can be written just pixels[i]).
And you can just use copy(), actually... The latter might be slightly slower (I doubt you will find a real difference) but allows scaling.
Re: Twou windowed sketch with a tiny monitor screen.
Reply #4 - Sep 5th, 2009, 7:25pm
 
yeah, I found out that I din't need all that code a while later hehe.
Thanks anyway! Smiley
Page Index Toggle Pages: 1