I'm making a game and I've created a separate thread for loading assets, 3d models, etc. So that the UI thread won't lock up while its loading. However, the thread for loading requires an instance of GL10 in order to load and map textures correctly.
Heres an overview of the problem so you can better understand my predicament:
1. my Renderer class creates and starts the "loading" thread.
2. The loading thread loads the models and textures from assets
3. 'glGenTextures' is required to load the textures, but the loading thread doesn't have an instance of GL10
I tried just giving the loading thread the GL10 instance given by the Renderers onSurfaceCreated method, but it doesn't work.(I guess it gets deleted, or messed up, or something when the function is over)
So, how would I be able to pass a working instance of GL10 to my loading thread?