2 Displays

Hi,

If I use a projector, is there a way to display a second (identical) window on the laptop screen? Or would it be wiser to mirror displays anyway?

Thanks!

Answers

  • Do you have a reason not to just mirror the displays?

  • Kind of. For example I could still control the input volume, check my emails, read the news etc. while I do visuals. :-)

  • edited October 2015 Answer ✓

    Is it possible? Sure. Just create another PApplet that shares the same "model" as the one you're projecting. Something like this:

    float ballX;
    float ballY;
    
    void setup() {
      size(100, 100);
    
      String[] args = {"SecondApplet"};
      SecondApplet sa = new SecondApplet();
      PApplet.runSketch(args, sa);
    }
    
    void draw() {
      ballX = mouseX;
      ballY = mouseY;
      background(0);
      ellipse(ballX, ballY, 10, 10);
    }     
    
    public class SecondApplet extends PApplet {
    
      public void settings() {
        size(100, 100);
      }
      public void draw() {
        background(0);
        ellipse(ballX, ballY, 10, 10);
      }
    }
    

    But you should generally favor simple solutions (like simply mirroring your display) over more complicated solutions. Whether the ability to look at the news is worth the complication of your code is up to you.

  • edited October 2015

    I was obviously joking about the news reading, but if it’s complicated or takes a lot of system resources it’s not worth doing it.

    Anyway could be useful for other projects maybe, thanks a lot for your help KevinWorkman!

  • Well, it's not that complicated, as the code I posted above hopefully shows.

    But it is twice as complicated as just having the one display, and twice as CPU intensive as well. That might not matter very much, and it might be worth it. But then again, if your sketch is already pushing the limits of your CPU, then maybe the additional complication is no longer worth the trouble. It's really up to you.

  • Yeah, I’m doing live visuals with my programme so CPU performance really matters a lot. Cheers!

  • edited October 2015

    [edit] Nevermind, read the question too fast...

    If you go to Processing Preferences pannel you can select which display you want to run your sketches on, easy as that

  • Thanks willemkempers for your comment. I know that you can select the display in the preferences … the thing is just that sometimes when I’m on stage I’m facing the crowd and not that screen.

    Anyway mirroring displays works fine.

Sign In or Register to comment.