I’m having some difficulty getting a GL3 context now that I’ve
switched to QtJambi. When casting my gl object to GL using getGL3, it
throws the error “javax.media.opengl.GLException: Not a GL3
implementation”.
This is my original code when I was using swing…
GLProfile profile = GLProfile.get(GLProfile.GL3)
GLCapabilities glCaps = new GLCapabilities(profile)
glCaps.setPBuffer(true)
GLPBuffer pbuffer =
GLDrawableFactory.getFactory(profile).createGLPbuffer(glCaps,
new DefaultGLCapabilitiesChooser(),
1, 1, null)
canvas = new GLCanvas(glCaps, new DefaultGLCapabilitiesChooser(),
PanelGL.pbuffer.getContext(), null)
Switch to QtJambi, I have the following code:
GLProfile profile = GLProfile.get(GLProfile::GL3)
GLCapabilities glCaps = GLCapabilities.new(profile)
glCaps.setPBuffer(true)
factory = GLDrawableFactory.getFactory(profile)
ctx = factory.createExternalGLContext
gl = ctx.getGL.getGL3
This last line throws an error. I’ve seen this page
(http://www.java-gaming.org/index.php?action=printpage;topic=21064.0),
which solves the issue, but it’s passing something to a GLCanvas
constructor, which is swing. Is there an equivalent setup in QtJambi
to get me a GL3 object?