Hi
I'm worried about (though haven't came across yet) the problem that the main loop will be blocked when loading a lot of textures at a same time (when starting the game). I think I should use multithread, but I noticed Irrlicht is not multithread safe. Also in another post (below) greenya said only 'addTexture' and 'setMaterialTexture' should be synchronized. So that means I can run the main loop while using another thread to load some other textures and don't worry about any synchronization? Also he said if with OpenGL, I should call those two functions in the same thread I create the device. If so, maybe the best way to fit all platform is to use a new thread to run main loop and use the first thread (who has created the device) to load textures?
I didn't find much information in the document, so please help. Thanks
http://irrlicht.sourceforge.net/forum/v ... =1&t=46791
Continue drawing when loading a lot of resources?
Re: Continue drawing when loading a lot of resources?
The comments are technical. Generally, you can't load textures on the non-OpenGL thread. You can only do it if you separate the operations of loading the textures and of registering them with OpenGL. If you know how to do this, you should be right.
Re: Continue drawing when loading a lot of resources?
Oh, I see. In fact I thought maybe I can use OpenGL in two threads before. So do you mean I can't do this and should instead use 'createImageFromFile' and 'addTexture'?mongoose7 wrote:You can only do it if you separate the operations of loading the textures and of registering them with OpenGL.
Thanks for your answer!
Re: Continue drawing when loading a lot of resources?
Also I hope I can use a single method in all devices, and will not have any problems if I need to change to another one.