Re: glBegin/glEnd inside methods of MouseListener
Posted by rhdxmr on Dec 06, 2010; 3:28pm
URL: https://forum.jogamp.org/glBegin-glEnd-inside-methods-of-MouseListener-tp2023145p2027960.html
thanks for your advice.
But makeCurrent()/release() in mousePressed() doesn't work for me..
I found
- that display(..) and mousePressed(..) runs in the same AWT-EventQueue-0
- and that if release() is not called at the end of codeb AWT-EventQueue-0 can't get out of GLContext
and then no more AWT event can be performed :(
- and that public void display(GLAutoDrawable drawable) {
System.out.println(drawable.getContext().hashCode())
} (called automatically by event)
and public void mousePressed(MouseEvent e) {
System.out.println(this.canvas.getContext().hasCode())
} (called automatically by mouse event)
prints the same hash value.
- and I realized that it's not a good decision to make OpenGL rendering be multi-threaded.
But that only one thread dedicated to OpenGL rendering and the other threads covering the rest part is better.
However I still wonder for curiosity why makeCurrent()/release() doesn't work.
Thank you for reading my ugly English...(Even if you tried to read but failed to understand..)