[vtkusers] How to do a parallel render?

Michael Jackson mike.jackson at bluequartz.net
Tue Jan 13 08:05:40 EST 2009


There have been several threads asking this question in the past. The  
basics are that you can not call "Render()" from anything other than  
the main thread. OpenGL does not like being called from different  
threads.

   Some folks use a polling mechanism in the main thread looking for a  
variable to change then call render when it does change. Some other  
folks have used a notification system across threads to make it work.  
Either way you need some additional code to make it work.

All that was assuming that was the problem in the first place :-)
_________________________________________________________
Mike Jackson                  mike.jackson at bluequartz.net
BlueQuartz Software                    www.bluequartz.net
Principal Software Engineer                  Dayton, Ohio



On Jan 13, 2009, at 1:19 AM, chen Yanda wrote:

> hi ,all
>    In my program, i use the method Render() of vtkRenderWindow in my  
> main() fuction. But I also want to use Render() in a thread which  
> create by HANDLE hMainThread=CreateThread(NULL,0,MainThreadProc, 
> (LPVOID)main,CREATE_SUSPENDED,&ThreadID). when  it run, the error  
> will be take place. It is that the request resource is using. 
> (vtkErrorMacro("wglMakeCurrent failed in MakeCurrent(), error: "
>                         << (LPCTSTR)lpMsgBuf);)
> I mean that in my main fuction, firstly, i create a background  
> thread to read some bmps from disk and create the actor, and than  
> use Render() to render it in my vtkRenderWindow which is used  
> Render() in main at last. At that time, the error will be take place  
> in vtkWin32OpenGLRenderWindow::MakeCurrent() line 244. How to settle  
> this problem? Thanks!
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list