Is it possible to load GL textures inside a Thread with JOGL and use them in a shared context ?
I think, u should have something like a texturefactory, that loads the file into a BufferedImage and converts it into a bytebuffer, also it should prevend from loading the same texture twice.
Then there have to be some sort of sync with your jogl thread, to notice him, that the texture is loaded and ready to be binded.
Than the jogl thread should have access to some sort of a TextureLibrary, which also knows, if the texture is already binded, if it is in the graphicscard memory, etc.
The texturefactory should have something like this:
public int bind(Texture2D tex)
{
/* look if it is already binded */
/* if not, maybe convert it and bind it */
/* return the bindid */
}
also look at this thread for a good implementation of such things. only, u will have to split the TextureLoader into a Converter file -> BufferedImage/ByteBuffer and a Converter Image/buffer -> opengl int
http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=jogl;action=display;num=1058674409
i also tried to load texture in multiThread, by i get an error, it says like gl can not run in multiThread