Posted by
Sven Gothel on
Mar 08, 2011; 4:39am
URL: https://forum.jogamp.org/NPE-when-getting-GLDrawableFactory-tp2276026p2649487.html
On Monday, March 07, 2011 12:36:53 François Coupal [via jogamp] wrote:
>
> I fiddled around the source code for the VersionApplet program, with Sven
> direction about the source code
>
> > The only requirement here is that the shared resources for the target
> > device
> > have been initialized.
> > In short: 'GLProfile.initSingleton(false);' shall be passed.
> >
> >
http://jogamp.org/git/?p=jogl.git;a=blob;f=src/newt/classes/jogamp/newt/awt/opengl/VersionApplet.java;h=18524d0bac330afbd04a425720d548170da84de7;hb=HEAD#l103> >
> > // shortcut:
> > GLProfile.initSingleton(false);
> > List/**/ availCaps =
> > GLDrawableFactory.getDesktopFactory().getAvailableCapabilities(null);
>
> I tested this, and this is not the info I am looking for, although it does
> work. The content of such a list are like this:
>
> GLCaps[0x21 0x75: on-scr, rgba 8/8/8/0, opaque, accum-rgba 16/16/16/16,
> dp/st/ms: 24/8/0, dbl, mono , hw, GLProfile[GL2/GL2]]
> GLCaps[0x21 0x75: offscr, rgba 8/8/8/0, opaque, accum-rgba 16/16/16/16,
> dp/st/ms: 24/8/0, dbl, mono , hw, GLProfile[GL2/GL2], pbuffer [r2t 0, r2tr
> 0, float 0]]
>
> What I need to get are the extension list. That list is availiable later in
> the code in the "init()" method of a GlCanvas, hence after it has been made
> visible by a frame of some kind. the code line is this:
>
> JoglVersion.getGLInfo(gl, null).toString();
>
Ok .. so not the GLCaps .. fine.
> The problem is that it needs a GL object, and the associated context. If I
> try to access that info before the windows made visible I'm back into the
> NPE which are the scope of this thread.
Orthogonal problems.
Thank you for #460, please reopen it if not done yet,
I will have a look at it next week.
(Currently 'on tour' until next Wednesday).
Assuming the bug is fixed, you can use an offscreen glcontext to query
the extensions or the shared resources (we may like to have an public API for it).
Cheers, Sven