R: [Plib-users] Threads and textures
Brought to you by:
sjbaker
From: Paolo L. <p.l...@ci...> - 2006-01-12 12:23:23
|
> -----Messaggio originale----- > Da: pli...@li...=20 > [mailto:pli...@li...] Per conto di=20 > Curtis L. Olson > Inviato: mercoled=EC 11 gennaio 2006 21.28 > A: pli...@li... > Oggetto: Re: [Plib-users] Threads and textures >=20 >=20 > Tinoshi Kitazawa wrote: >=20 > > I think I have got a problem related with OpenGL context and > > threads... I'm loading my database in a secondary thread,=20 > and textures=20 > > are not loaded!!! if i print(stdout," ",3) the Leaf i load,=20 > textures=20 > > handles are always set to 0, while geometry (vertex) are correctly=20 > > drawn. If I load the database in the main thread, textures=20 > are loaded! > > I tryed to pass to the thread the ssgGetCurrentContext() and to=20 > > makeCurrent() just inside the thread function, but I=20 > doesn't work...=20 > > What can I do??? > > =20 > > Thanks!!! > > =20 > > P.S. OS is WindowsXP, I use Visual Studio 6.0 >=20 >=20 > I'm not an opengl guru, but we have the same issue with FlightGear. =20 > Basically opengl is not multithreaded. In other words, if=20 > you generate=20 > opengl calls from multiple threads, you can expect that the=20 > calls will=20 > be interleaved in unpredictable ways and cause all kinds of strange=20 > behavior and problems. The fact that your program actually survived=20 > this without crashing is actually a bit surprising! :-) Loading/filling a SSG scene graph shouldn't involve OpenGL as far as = don't create display lists for leaf nodes - excepting textures, which, infact, seems to arise the problem. Greetings - Paolo Leoncini |