Keep P3D running when surface is not visible

Is there a way to keep P3D running when the surface is not visible?

void setup() {
  size(600, 600, P3D);
  PSurfaceJOGL surface = (PSurfaceJOGL) getSurface();
  surface.setVisible(false);
}

void draw() {
   println(frameCount); 
}
1 Like

In theory, you could make a separate thread that has access to your main class and have it call draw() every 1/60th of a second (or whatever your frame rate is).