Loading...
Logo
Processing Forum
With GLGraphics 1.0 when I execute this code:

Copy code
  1. Thread thread = new Thread(new Runnable()
  2. {
  3.       @Override
  4.       public void run()
  5.       {
  6.             image = loadImage(filename);
  7.             texture.putImage(image);
  8.       }
  9. });
  10. thread.start();
where image is a PImage and texture a GLTexture, I get an Invalid Memory Access error, because of the line 7.
Is it possible to put a PImage into a GLTexture in a thread different from the main?

Thanks.
paolofuse

Replies(2)

I believe this is a limitation of JOGL 1.1.1 or OpenGL itself.  You have to have the GL context in order to load the texture.  The one thing I've found that can be done is that you can load the TextureData in a separate thread, then load the TextureData into the Texture in the main thread, perhaps saving a little time.  However, last I checked with JOGL 2.0, which Processing 2.0 will use, the TextureData also required the GL Context (main thread) for loading.
Ok, I think you're right.
Thanks.