Building display lists outside of display.

I’m having a little problem building a display list. Say I have a function called “makeObj” to build a display list. If I call “makeObj” from the display function of my GLEventListener everything works fine. But if I call “makeObj” from anywhere else, the display list doesn’t get built and hence doesn’t display. “makeObj” doesn’t make use of the GLDrawable arg to display but references it directly.

Any ideas?

thanks

Uh, define ‘anywhere else’. You can’t tinker with OpenGL state from outside of the proper thread (which just happens to be the one that calls the GLEventListener stuff), so you can’t create lists in AWT button events etc.

If you’re sure you’re calling from the right place (Animator’s render method is the usual place) then post some code…

Thanks. That’s what I needed to know. I am trying to call it from outside that thread using a Swing button.