New to JOGL and have a simple question. It’s well documented that you’re not supposed to use getGL() outside of any GLEventListener method. I’m curious how I would go about updating textures, etc. in a multi-threaded app without having this ability.
I have a bunch of GLCanvases that I update with an array of pixels every second. Under Java2D I would just have an update( float[] pixels ) method that would insert the pixels into an offscreen image (and then a repaint() ) but with JOGL I can’t do:
public void update( float[] pixels ) {
myCanvas.getGL().glTexSubImage2D( ) <-- pass in pixels to update texture here
}
Hopefully this is clear enough. I’m sure this is a common situation but it’s not clear to me how to do it with JOGL. Help would be great appreciated.