Re: Can't get GL2 from GL2GL3 on Mac OSX
Posted by
Sven Gothel on
Apr 09, 2014; 3:05pm
URL: https://forum.jogamp.org/Can-t-get-GL2-from-GL2GL3-on-Mac-OSX-tp4032133p4032134.html
On 04/09/2014 04:26 PM, orenbum [via jogamp] wrote:
> I'm getting a "Not a GL2 implementation" exception when I try to get a GL2
> object after requesting a GL2GL3 profile on Mac OSX with the latest version of
> jogl (2.1.5-01 from maven). On other platforms the code below executes without
> any errors:
>
> public static void main(String[] args) throws Exception {
>
> GLProfile profile = GLProfile.get(GLProfile.GL2GL3);
>
> GLDrawableFactory drawableFactory = GLDrawableFactory.getFactory( profile );
> GLCapabilities caps = new GLCapabilities( profile );
> GLOffscreenAutoDrawable offscreenDrawable = drawableFactory.createOffscreenAutoDrawable( null, caps, null, 1, 1 );
> offscreenDrawable.display( );
> GLContext context = offscreenDrawable.getContext();
>
> GL gl = context.getGL();
> GL2 gl2 = gl.getGL2();
> }
>
>
> But on my macbook I get the following:
>
> Exception in thread "main" javax.media.opengl.GLException: Not a GL2 implementation
> at jogamp.opengl.gl4.GL4bcImpl.getGL2(GL4bcImpl.java:37087)
> at com.oren.GL2Test.main(GL2Test.java:26)
>
>
> So should we be able to get a GL2 object back there?
Nope .. the highest available, which is a core profile on OSX
since the latter doesn't support FFP (fixed function pipeline) for GL >= 3.0.
Pls check the GLProfile.getMaxFixed...() methods how to get the highest
available FFP profile.
~Sven