Problem creating textures from another thread

Started by
1 comment, last by Stazh 17 years, 7 months ago
Hy there. I have a problem with creating textures (using glTexImage2D and gluBuild2DMipmaps) from "loading" thread. I use this thread for loading purposes (doh :D ) and when i call these functions for creatig textures in OpenGL it does nothing. When i try to create textures from my main thread all works fine. Does some one know how to fix this. Btw this is my first post, so, hy everyone :D
Advertisement
You can't tinker with OpenGL from multiple threads at the same time. You can either 1) make the GL context 'current' (exact implementation varies depending on platform) while loading your texture, but that can be tricky to do correctly and will likely stall your rendering. Or 2) do the bulk of the loading in a separate thread but hand off the actual texture creation and data upload to the main thread.
Thanks. I will devide texture loading from texture creating then.

This topic is closed to new replies.

Advertisement