I get an Exception Exception in thread "AWT-EventQueue-0" javax.media.opengl.GLException: No OpenGL context current on this thread
here's the deal :
i get the identifiesr for my displayLists with :
1 2 3 4 5 6 7 8
| public static void createLists(GL gl, GLU glu) { MyGL.gl = gl; MyGL.glu = glu; sphere = gl.glGenLists(1); alterLists(); } |
then i create the lists with
1 2 3 4 5 6 7 8 9 10 11 12
| public static void alterLists() { GLUquadric quadric = glu.gluNewQuadric(); glu.gluQuadricTexture(quadric, true); glu.gluQuadricDrawStyle(quadric,GLU.GLU_FILL); glu.gluQuadricNormals(quadric, GLU.GLU_SMOOTH); glu.gluQuadricOrientation(quadric, GLU.GLU_OUTSIDE);
gl.glNewList(sphere,GL.GL_COMPILE); glu.gluSphere(quadric,1,ballAtomComplexity,ballAtomComplexity); gl.glEndList(); } |
and this works fine, but later i have a ruler to chage the complexity (stack and slice number) of my sphere. When the new value for ballAtomComplexity is set by this ruler, i call again the method alterLists(), and then i get the exception with the line glu.gluSphere ....
I don't understand, since the GLU object is the same (i stored it when create the display list IDs
i also tried to put a glu = new GLU(); but its the same
i have no problem with gl.xxxxxxxxxx methods
any hint ?
Thx