From: Brian P. <br...@tu...> - 2002-09-24 19:13:32
|
John A. Stewart wrote: > Hi all; > > This is Mesa and generic OpenGL based. I'd like to, in C, > fork a process to render textures into OpenGL textures, > rather than have the main thread do this. > > Can I simply fork() a process, then use the parent's > GLXContext as the shareList parameter to the child's > glXCreateContext() call? > > Any hints/tips/war stories? In general, you can't do this. The GLX specification states that for context sharing to take place, the two contexts' processes must share the same address space. That won't be true if you fork/exec. One exception is indirect GLX rendering. In principle, two separate indirect GLX clients can share a GLXContext handle. I wouldn't be surprised if that's a buggy path and wouldn't recommend it. Have you considered using threads? Mesa and OpenGL are thread-safe and context sharing among threads should work. -Brian |