Re: transfer images from TextureData to a Texture off of the EDT in JOGL
Posted by
gouessej on
Aug 01, 2014; 1:54pm
URL: https://forum.jogamp.org/transfer-images-from-TextureData-to-a-Texture-off-of-the-EDT-in-JOGL-tp4032678p4032682.html
You might have some troubles if you make the same OpenGL context current on several distinct threads and it has nothing to do with JOGL, it depends on multi-threading support in the driver. When it works, it is really fine :) You can be bothered by the AWT global lock if and only if you use an AWT drawable, typically the AWT GLCanvas. If you want to "do real multi-threading", use NewtCanvasAWT or GLWindow. Do you know whether WWJ provides a canvas based on NEWT? Do you absolutely need to use Swing and/or AWT in your application?
Edit.: WorldWindowGLCanvas uses AWT. It should be possible to write another WWJ canvas based on NewtCanvasAWT or preferably GLWindow.
Edit.2: AWTGLAutoDrawable is used in WorldWindowGLAutoDrawable. You'd need a drawable that doesn't make such assumptions on the drawables.
Edit.3: Actually, WorldWindowGLAutoDrawable should be divided into 2 classes, a "general" abstract drawable class with no dependency on AWT and a concrete class extending it that would do exactly the same thing than WorldWindowGLAutoDrawable but that would be in gov.nasa.worldwind.awt. After that, you could create a concrete drawable class using NEWT and extending the abstract drawable class. Finally, you could create a class WorldWindowGLWindow like WorldWindowGLCanvas but using NEWT instead of AWT.