GLCanvas and contexts

Hi,

I know that JOGL have some stability isssues in this field but I just wanted to check if there is som general “always working” canvas init routine. Basically most of the time it works but sometimes I do not get a GL context. Here’s my routine:


frame = new JFrame();

canvas = A9RenderFactory.getFactory().createJOGLCanvas(this, capabilities);

canvas.setSize(width, height);
frame.setVisible(true);
frame.getContentPane().add(canvas);
frame.pack();
frame.addWindowListener(this);
frame.setTitle("Application"); 


Rocksolid under Win2000
Misses glcontext occasionaly under WinXP and Linux.

Cheers
// Tomas :slight_smile:

From the GrexEngine site unofficial JOGL faq:

“One of the undocumented aspects of JOGL is that you can’t mess with the canvas before it is attached to a screen resource. That means no calls to setSize or anything like that until you add it to a Frame.”

So, the call to setSize is probably the cause for the bad behaviour you’re experiencing… :slight_smile:

Great, thanks!

I’ll do some stability testing with that.