I'm now sure that the call to glGenTextures didn't return. I can think of three reasons:
- Another wine thread is just doing a call to libGL
- The libGL of Nvidia has a bug
- both of the above
If you run with +ddraw,+tid and you get two different numbers before the lines, you are hit by a bug that will be a bitch to fix : multithreaded Direct3D applications...
yes, that's the case. glGenTextures seems to be the first gl call of the new thread.
This is something I have no real clue yet how to fix in the 'general' case (I have some ideas for two of the games I have that exhibit the issue).
I did a "bad hack" and replaced glGenTextures with own code (only a static variable that gets increased after each call). That works fine for me.
After google-ing a bit I think it is necessary to make a glXmakeCurrent() call before using a gl-call in a new thread (at least for the Nvidia GL-driver, DRI should work). Not all GL-calls are affected but definitely the textures calls.
Bye, Michael