Re: [Plib-users] Threading
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2001-04-11 21:59:17
|
Treasa Parakkat wrote: > Can PLIB run in a separate thread? I mean, can my main program spawn off a > thread that does all my PLIB calls without any problems? Yes...if *all* the PLIB calls happen in that one thread - and all the OpenGL calls in that same thread - then there should be no problems. What you can't do is things like playing with the scene graph in one thread and rendering it in the other because there is no internal protection against that kind of thing. With extreme care, you could do things like building a new section of scene graph in one thread - and rendering a disconnected part of the scene graph in another - then when both processes finish working, connecting the new scene graph segment into the main tree. Similarly, you could disconnect a section of the tree (when you know the rendering thread is idle) and delete it in the other thread. Those things are tricky and not 100% guaranteed - but for what you describe, there shouldn't be a problem. > Also, when running PLIB, does it spawn any threads or create any new > processes? No...although the underlying OpenGL implementation might. -- Steve Baker HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://web2.airmail.net/sjbaker1 Projects : http://plib.sourceforge.net http://tuxaqfh.sourceforge.net http://tuxkart.sourceforge.net http://prettypoly.sourceforge.net http://freeglut.sourceforge.net |