Hello everyone!
I recently decided to make a little 3D Java game using jogl. So I downloaded the current release JSR231 (not the nightly built) and tried to get started with the help of some tutorials and demos.
I soon noticed that all code examples use a line like
GLCanvas canvas = GLDrawableFactory.getFactory().CreateGLCanvas (glcaps);
The method CreateGLCanvas does not exist anymore in the current release but is replaced by createExternalGLContext. So I read through everything I could find about it (mainly the API) and tried to make it work like this, even without examples. I have to admit I am a rookie in 3D programming…
So I created some starting code like:
final GLCapabilities glcaps = new GLCapabilities();
GLCanvas glcanvas = new GLCanvas(glcaps);
final GLContext glcontext = GLDrawableFactory.getFactory().createExternalGLContext();
But when I try to make it run using eclipse I get an error message like:
Exception in thread "main" javax.media.opengl.GLException: Error: attempted to make an external GLContext without a drawable/context current
I guess I have to make the glcanvas the current one first, but I really have no idea how, could not find anything in the jogl API.
Any help would be greatly appreciated, also any hint about whether I should really use this current release or maybe an earlier one?
Thanks a lot in advance,
Eric