You can actually still do what you want with one spanned display using gl.glViewport(startx,starty,width,height);
That sets all the drawing to just one area, so you can call that command for the left side, covering the whole screen, do all your drawing, then call it again with the position of the right screen, and do that one.
e.g. (assuming 2 1024*768 displays)
Code:import processing.opengl.*;
import javax.media.opengl.*;
import javax.media.opengl.glu.*;
GL gl;
GLU glu;
PGraphicsOpenGL pgl;
void setup()
{
size(2048,768,OPENGL);
pgl=((PGraphicsOpenGL)g);
gl=pgl.gl;
glu=pgl.glu;
}
void draw()
{
background(0);
//required....
pgl.beginGL();
gl.glViewport(0,0,1024,768);
pgl.endGL();
perspective(PI/3.0,1024.0/768.0,0.001,10000);
camera(0,0,-300,0,0,0,0,-1,0);
//end of required.
noStroke();
sphere(50);
pgl.beginGL();
gl.glViewport(1024,0,1024,768);
pgl.endGL();
perspective(PI/3.0,1024.0/768.0,0.001,10000);
camera(0,0,-300,0,0,0,0,-1,0);
noStroke();
box(50);
}
Note some commands still affect everything e.g. background();