Hi all,
I built a JFrame containing 2 glCanvases.
I linked each canvas with a different renderer, implementing the GLEventListener interface. Each renderer has its own Animator.
It doesn’t work : rendering is weird. It looks like parts of rendering are past to the other glCanvas.
Any ideas ? is this GLContext or multi-threading issue ?
/* Generated with neatbeans */
public class SelectorDialog extends javax.swing.JDialog {
....
private GLCanvas canvas1;
private GLCanvas canvas2;
public GLCanvas getCanvas1() {
return canvas1;
}
public GLCanvas getCanvas2() {
return canvas2;
}
}
public View1 implements GLEventListener {
...
}
public View2 implements GLEventListener {
...
}
public class MySelector extends Selector {
public MySelector() {
GLCanvas canvas1 = getCanvas1();
canvas1.setAutoSwapBufferMode(true);
View1 view1 = new View1();
canvas1.addGLEventListener(view1);
FPSAnimator animator = new FPSAnimator( canvas1 , 60 );
animator.setRunAsFastAsPossible(false);
animator.start();
GLCanvas canvas2 = getCanvas2();
canvas2.setAutoSwapBufferMode(true);
View2 view2 = new View2();
canvas2.addGLEventListener(view2);
FPSAnimator animator2 = new FPSAnimator( canvas2, 60 );
animator2.setRunAsFastAsPossible(false);
animator2.start();
setVisible(true);
}
}