G4P multi-windows fullscreen?

Hi all, I'm working with the G4P library to create a two-window sketch to run on a computer with two screens. My goal is to have one 'controls' window on one screen, and another 'display' window running fullscreen on the second display.

I have a semi-working sketch based on the G4P example. My question is how to get the GWindow to go fullscreen. I know how to do this in a one-window Processing sketch, just can't figure out how with the GWindow methods.

Here's the demo code I'm playing with at the moment. Any help is greatly appreciated!

/*
make a 2-window sketch, with controls in one that affect the other

*/

import g4p_controls.*;

GSlider sdr1, sdr2;
GWindow secondWin;

void settings(){
  //fullScreen(P3D, 2);
  size(600, 280); 
}

void setup() {

  secondWin = GWindow.getWindow(this, "Window 2", 300, 300, 200, 200, P3D);
  secondWin.addDrawHandler(this, "windowDraw");

  //=============================================================
  // Simple default slider,
  // constructor is `Parent applet', the x, y position and length
  sdr1 = new GSlider(this, 20, 20, 260, 50, 10);
  // show          opaque  ticks value limits
  sdr1.setShowDecor(false, true, true, true);
  sdr1.setNbrTicks(5);
  sdr1.setLimits(100, 0, 200);
  //=============================================================
  // Slider with a custom skin, check the data folder to find 
  // the `blue18px' folder which stores the used image files.
  sdr2 = new GSlider(this, 20, 80, 260, 50, 10);
  // show          opaque  ticks value limits
  sdr2.setShowDecor(false, true, false, true);
  // there are 3 types
  // GCustomSlider.DECIMAL  e.g.  0.002
  // GCustomSlider.EXPONENT e.g.  2E-3
  // GCustomSlider.INTEGER
  sdr2.setNumberFormat(G4P.DECIMAL, 3);
  sdr2.setLimits(100, 0, 200);
  sdr2.setShowValue(false); 
}

void draw(){
  background(0);
  fill(255);
  //ellipse(sdr1.getValueF(),  sdr2.getValueF(), 10, 10);
}



public void windowDraw(PApplet appc, GWinData data) {
   appc.background(0);
   appc.fill(255);
   appc.ellipse(sdr1.getValueF(),  sdr2.getValueF(), 10, 10);
}

Answers

Sign In or Register to comment.