I'm trying to get SWT working with the newest JOGL (2.0).
I tried SWT snippet 209, but it doesn't work. The problem is caused by the following line:
final GLContext context = GLDrawableFactory.getFactory().createExternalGLContext();
...but when I change getFactory() to getFactory(GLProfile.getDefault()) (to make it compatible with the new API), it crashes on createExternalGLContext() with javax.media.opengl.GLException: Error: current context null. I don't understand this message: I'm trying to create a new context, and it complains that the current is null. Why?
Maybe there is some other way to create a GLContext?
Or maybe it is possible to use GLEventListener with SWT GLCanvas?
PS. I placed my modified version of the snippet here.
Edit: now I understand the error message. Documentation says:
The underlying OpenGL context must be current on the current thread at the time this method is called.
How to create the first GLContext?