Hi,
Using JOGL to create a display list. This is initalized in the .init() function. The display list is then written in the .display() function.
Occasionally, an event occurs that requires the display list to be updated. The function to update the display list works just fine when it takes a GL object passed from the .display() or .init() functions (obtained by GL gl = GLAutoDrawable_object.getGL()).
When calling it from a different that does not have direct access to the GLAutoDrawable object, I’ve tried to obtain the GL object form the Canvas object using Canvas_object.getGL(); my understanding is that this should work in the same way. However, I am getting the following exception:
Exception in thread “AWT-EventQueue-0” javax.media.opengl.GLException: No OpenGL context current on this thread
at javax.media.opengl.glu.GLU.getCurrentGL(GLU.java:234)
at com.sun.opengl.util.GLUT.glutBitmapString(GLUT.java:297)
at DrawPromoter.Legend(DrawPromoter.java:295)
at DrawPromoter.initPromoters(DrawPromoter.java:323)
at DrawPromoter.mouseWheelMoved(DrawPromoter.java:517)
at java.awt.Component.processMouseWheelEvent(Component.java:5576)
at java.awt.Component.processEvent(Component.java:5260)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
I’ve tried several things. Using the following code redraws the display list once, but subsequently the program crashes (no exception, but the program just freezes, and I have to kill the process):
GLContext context = canvas.getContext();
context.makeCurrent();
GL gl = context.getGL();
I am working in Open SuSe 10.1; and using software rendering (Mesa-6.4.2-19@i586).
Am I doing something wrong? Is this a bug in JOGL or Mesa? If so, is this something I should report to the appropriate project?
Tried to keep the message short as possible, if you need more of my code to help find the problem, let me know.
Thanks very much for your responses,
Charles