Re: JOGL 2 support for Ardor3D, JMonkeyEngine 3, jzy3d and NiftyGUI
Posted by Sven Gothel on Sep 27, 2011; 8:57am
URL: https://forum.jogamp.org/JOGL-2-support-for-Ardor3D-JMonkeyEngine-3-jzy3d-and-NiftyGUI-tp1706747p3372021.html
On Monday, September 26, 2011 10:40:01 PM gouessej [via jogamp] wrote:
>
> Hi
>
> I now use MainThread.invoke(false) to queue runnables executing OpenGL
> operations,
Good you mention this here. Please do not!
Why not GLAutoDrawable's 'invoke(boolean wait, GLRunnable glRunnable)' ?
It's intended for this purpose (I guess).
Another best candidate would be your window's EDT.
However, NEWT's MainThread class is only a tool to
allow some OS (MacOSX) to be able to funcion somehow.
(Yup, working on it again, see commits)
MainThread's purpose is not to provide one big EDT
for rendering commands (like AWT) :)
I actually changed MainThread already, removed it's EDTUtil implementation,
so it 'justs' kicks of the Java class main thread/call and may
delegate to NSApp.run() if on MacOSX.
> it works better now but which methods of NewtCanvasAWT must be
> called with MainThread.invoke(false)
NONE
> and which one must be called on the AWT
> EDT?
All modifications to the AWT component.
This is what the AWT spec says.
After make visible, do all AWT-mods on AWT-EDT,
also the AWT setVisible(true) as well.
> I still get sometimes some GLExceptions. Should the Newt child be
> created on the AWT EDT?
The NewtCanvasAWT is an AWT component.
None of the pure NEWT window operations must be handled in a special way,
since they are all implemented to be run on their NEWT Display EDT
if required.
> If so, could you change the visibility of the method
> setNEWTChild to public please? Best regards.
Hope this helps. If in doubt, pls study the unit tests.
However, I guess the above rules of thumb should be enough.
Laters, Sven