[vtkusers] about multithread in VTK

Yixun Liu yxliu at fudan.edu.cn
Mon Nov 21 04:24:31 EST 2005


Hi,
I use vtk and MFC to develop an application. Rendering a volume in Ondraw() method is very time consuming. So I intend to create a thread in Ondraw() method to render it. The code is as below:

//use thread to visualize
UINT Rendering(LPVOID pParam)
{
  CView* pView = (CView*)pParam;

  if ( !pView->iren->GetInitialized() )
  {

    CRect rect;
    pView->GetClientRect(&rect);

    pView->iren->Initialize();
    pView->renWin->SetSize(rect.right-rect.left,rect.bottom-rect.top);

  }

    pView->renWin->Render();
 return 0;

}


CView::Ondraw()
{
....
  AfxBeginThread(Rendering, this);
...

}

However the error is :choose pixel format is error

Anybody help me?

Regards,

Yixun Liu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20051121/c5218a51/attachment.htm>


More information about the vtkusers mailing list