Original Post
== short problem desc == - Can't display textures that loaded in another thread. == long problem desc == Hello. I've already search the GameDev and found many thread that discussed problems with multithreading with opengl, and most of answer suggest not to use multithreading with opengl. But it seems that I forced to use multithreading, based on my current condition: - I'm already in halfway through a game developing using OpenGL in Delphi. - The resource images that my program must preload before the game really is huge and the list keeps growing. That makes the waiting time became so long and long before I finally shown the opening screen. I'm also - Now I think about moving some of the loading parts into background threads that loading the leftover resources silently, when the foreground thread shows the opening screen. - The multithread is working nice. I just need to keep track of what texture that hasn't been loaded yet, and when that texture become available to the foreground thread system, I advance the opening screen to used the already loaded texture. For example: first I loaded the background screen in foreground thread. After that, I show the background screen moving, and I instruct the background thread to load the character face. So while the background screen is displayed, I silently load the character face. When the character's face is loaded completely, I slowly show the character's face to the screen in front of the background. And I instruct the background thread to load another images, and so on and on. - But the problem arise here. I'm definitely sure that the loading operation is working completely nice, because I'm only moved it and not making any modification, but it seems that *no* texture are being loaded to the openGL memory, even though the texture ID is valid (not zero). When I displayed one of the texture that already loaded by the background thread to the screen, it only shows a white rectangular, just like if the texture never been loaded to the memory. I checked out the texture ID once again, and yet it's still shows a non-zero ID (means that the texture already been loaded successfully into the memory). - I asked my friend that already has experienced the same sympton, and he said that it's really the limitation of OpenGL - that the OpenGL is not thread-safe. He said that once we leave the current thread which has the "true" OpenGL context, all the OpenGL calling method is not works, such as glBindTexture and such. But the one that keeps me wondering is that the OpenGL function that generates texture ID, the glGenTexture, is working! Why one function working, but another function is not working? I still doesn't understand until now. - I've read on another topic that the problem is located on the rendering context, that maybe I loaded the texture onto another context. - But, I've already passed the context that was created in the previous thread (foreground, renderer thread) onto the new thread (background, loader thread). And in the background thread, I used that context to load the texture, by using function such as the glBindTexture and gluBuild2DMipmaps, But still didn't change anything. But when I see some of the answers in this GameDev, even though it didn't answer my problems directly, I see that maybe there is a workaround solution over this limitation. Is there anyone can helps? Thanks.