Loading textures after init() method

Hi,

I have a problem loading textures after the GLEventListener.init() method is done. If I load textures while processing the init() method, I can use them without a problem later on. But if I want to load a texture, after the execution of init(), I always receive zero as texture id from glGenTextures(). Is their any relation between the init() and glGenTextures() method? Or is the generation of texture objects only allowed in a specific state in OpenGL?

ciao torsten

Generating textures later that the init() works fine, but you can only do GL related stuff like creating textures in the GL rendering thread (like the Animator .display callback).

I’ll guess you’re saving your GL object and trying to create the textures in another thread, which won’t work. You can do most of the heavy lifting in another thread but the final generation of id and uploading of data has to be in the GL thread.

Now it works, thx for help!!!