Login  Register

Re: GLContext version...

Posted by Matt on Jan 27, 2011; 11:55pm
URL: https://forum.jogamp.org/GLContext-version-tp2335528p2364630.html

Sven,

I am actually using SWT, so I have no GLAutoDrawable instance, I am using SWT's GLCanvas.

And well, after some debugging, here's what's going on:

As I mentioned, my external GLContext I am using has version string: "3.0 (compatibility profile, any, old) - 3.3.0", the very first two digits being its major and minor version, and preventing me from using getGL3(), as 3.1 is required.
And actually the created external context originally has version 3.3, but it is being downgraded in the GLContextImpl's setContextVersion(int major, int minor, int ctp) method:

// We cannot promote a non ARB context to >= 3.1,
// reduce it to 3.0 then.
if ( ( ctxMajorVersion>3 || ctxMajorVersion==3 && ctxMinorVersion>=1 )
     && 0 == (ctxOptions & CTX_IS_ARB_CREATED) ) {
    ctxMajorVersion = 3;
    ctxMinorVersion = 0;
}

so flag CTX_IS_ARB_CREATED is unset, and this is because of the constructor WindowsExternalWGLContext and its line:
setGLFunctionAvailability(false, 0, 0, CTX_PROFILE_COMPAT|CTX_OPTION_ANY);
of course manually adding flag CTX_IS_ARB_CREATED there does not result in anything good :) in my case it results in enabling the run of the application, but with 1000 times drop in fps, and total mess up in opengl contexts even for other instances of the app previously working correctly :)

Anyway, does this strictly mean that one cannot create external GLContext that would support opengl 3.1+ ?
If so, then am I forced to use Newt or Awt glcanvas? I read that Newt component is planned to replace the original SWT's GLCanvas. I could try to help with that, but need some info on the matter :)

Matt.