Hi,
I have a Swing GUI with a glCanvas on it and when I press a button on the Swing GUI I would like the canvas to redraw as the button press changes what is drawn to the scene. I can get this working fine when I don’t put my drawing code in a display list, but as soon as I use a display list the button press does nothing as if the list isn’t being called. I have an animator thread that is constantly calling the display() method which contains my display list. I know display is being called by Animator repeatedly because if i put debug statements in there it prints them out continuously. Can someone please advise whether or not there is a problem with my display list or offer some suggestions otherwise. If you require more information please ask.
In my init method I create the display list:
displayList = gl.glGenLists(1);
gl.glNewList(displayList, GL.GL_COMPILE);
// draw scene
gl.glEndList ();
In my display method I call it:
gl.glCallList(displayList);
If I remove the display list code and just use the drawing code in display(), the scene gets redrawn correctly after the button press. But I would like to use a display list.
Thanks in advance