displayLists outside of init method?

Can displayLists be created and used outside the init method?

I keep trying to overwrite the init’s displayList by creating a new one outside the init method with the same int reference “gl.glNewList(myListRef, GL.GL_COMPILE)” whenever I click the mouse, but I keep getting the original scene from the displayList I created inside init…

thanks…

You have to destroy the old display list first before you can reuse the reference number for that list.

Okay, I have tryed calling gl.glDeleteLists(myListRef) before setting up a newList and I it will delete the list but not display the one I have replaced it with, I can just see the background.

You can not store the GL reference and use it outside of your GLEventListener’s methods (init, display, reshape, etc.) If you need to update a display list upon mouse click, set a flag in your GLEventListener from your MouseListener and have the GLEventListener do the processing during the next display().

That worked like a charm, thanks so much… ;