Login  Register

Re: Multithready between AWT and JOGL

Posted by Sven Gothel on Sep 21, 2011; 10:40pm
URL: https://forum.jogamp.org/Multithready-between-AWT-and-JOGL-tp3356928p3357104.html

On Wednesday, September 21, 2011 11:35:36 PM Nick [via jogamp] wrote:
>
> Hello, I've got an incredibly difficult error and I'm not sure what is
> causing it.
> I'm working on a pick selection component for a game, and I use a
> MouseListener to 'schedule a pick-selection' using boolean values. After a
> pick-selection is scheduled, the GLAutoDrawable.display() method will check
> to see if it is scheduled, and if so, it will perform a selection.
>

long story short:
(as mentioned here: http://jogamp.org/jogl/doc/NEWT-Overview.html)

http://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/javax/media/opengl/GLAutoDrawable.html#invoke%28boolean,%20javax.media.opengl.GLRunnable%29
http://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/javax/media/opengl/GLRunnable.html
  http://jogamp.org/git/?p=jogl.git;a=blob;f=src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cSwingAWT.java;hb=HEAD#l203

Use 'GLAutoDrawable.invoke(GLRunnable)'
[for GLCanvas, GLWindow, ..]

We use this for our graph/UI false color picking algorithm and return false.

The idea is to inject this one shot GL runnable from another thread
not holding the GLContext.

Hope it helps.