Hi,
I have problems with multiple canvases, but only when disposing/removing them. In other words, I have small JOGL program that can open multiple canvases and doesn’t have problem with it – until I add the code that disposes of the old canvas (and its corresponding frame) and creates a new one each time a user opens new data file.
//frame to which canvas is added
Frame FWindow = new Frame();
FWindow.addWindowListener( new WindowAdapter() {
public void windowClosing(WindowEvent e){
// a) creates problems
/*
canvas.removeGLEventListener(listener);
canvas.removeMouseListener(listener);
canvas.removeMouseMotionListener(listener);
FWindow.remove(canvas);
FWindow.dispose();
*/
// b) no errors
System.exit(0);
}
});
The problem I’m getting in case a) is either
- “net.java.games.jogl.GLException: Unable to set pixel format 6 for device context”
when making frame visible
FWindow.setVisible(true);
or
- Canvas seems frozen and nothing is displayed (on rare occasions it recovers after being minimized, and sometimes it displays data but it doesn’t catch the mouse movements).
I’m using JOGL 1.1.1 version from July 12, 05 on Win XP, with Intel 82852/82855 GM/GME graphics controller.
Please help!!
Anita