Posted by Sven Gothel on Mar 04, 2011; 11:10pm URL: https://forum.jogamp.org/NPE-when-getting-GLDrawableFactory-tp2276026p2635935.html
On Friday, March 04, 2011 23:32:43 François Coupal [via jogamp] wrote:
>
> 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.
Even though it's true, that only after GLCanvas addNotify/display a valid
context/drawable/etc is instantiated, we shall not NPE. I would like to fix it.
>
> >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.
The only requirement here is that the shared resources for the target device
have been initialized.
In short: 'GLProfile.initSingleton(false);' shall be passed.
>
> 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.
interesting.
I guess we have to discuss the whole SWT 'behavior' much more in detail.
Good that we have Wade helping here.