Login  Register

Re: NPE when getting GLDrawableFactory

Posted by François Coupal on Mar 04, 2011; 10:32pm
URL: https://forum.jogamp.org/NPE-when-getting-GLDrawableFactory-tp2276026p2635854.html

Found a workaround fooling around with Wade Walker's AWT examples on the JogAmp wiki.

It appears that even though the canvas is created, it will not be able to process the default capabilities until a Frame has been created AND shown using the "setVisible(true)" method. Trying to access them will throw an NPE.

From that moment, it is possible to fetch default capabilities and create a PBuffer for graphic card verifications. Tried it with both the default profile (whatever it may be) and a GL2 profile.

I will try to use a NEWT-Based window toolkit to access a window-less PBuffer. If I can't then it would mean there are no way JOGL can fetch capabilities without the help of a window toolkit. I'd very much like to be proven wrong on this.

By the way, I've found that using the method "GLProfile.initSingleton(false);" in Eclipse causes the windows to be unresponsive to closing. I have to switch them to "true" to be able to close them using the window close button. It's the exact opposite behavior that is mentionned in the comment just above the code line in the basic examples.