Login  Register

Re: Problem Moving from 1.1.1a -> 2.0

Posted by gouessej on Mar 16, 2012; 9:15am
URL: https://forum.jogamp.org/SOLVED-Problem-Moving-from-1-1-1a-2-0-tp3826486p3831298.html

Hi

No, your approach is fine but maybe there is a smarter way to do it. It's possible to create an OpenGL context representing the one used by an external OpenGL-based library but I don't remeber whether it is possible to create a separate OpenGL context without creating any drawable. I should have a look at the source code of my JOGL renderer of Ardor3D to answer you more accurately. Anyway, it would be better to retrieve the context from the first really useful GLCanvas you create but this context will be destroyed if your GLCanvas is removed from its container (but not if you use a GLWindow).

In JOGL 2.0 (unlike JOGL 1), the context becomes available in addNotify(). Therefore, if you don't add your GLCanvas to any container, you'll have some problems... When I ported Ardor3D to JOGL 2.0, I had forgotten this change (my bad, I should sleep much more) and I simply had obtained some NPE for a long time.
Julien Gouesse | Personal blog | Website