<div>Hello,</div><div> </div><div>I've ran into an issue of VTK exiting the application if an offscreen rendering is requested for a large size render window. VTK has a very unforgiving error handling. It displays a system message box (at least on Windows) and then calls exit(1) if there are no vtkCommand::ExitEvent observers. Even if I install my own ExitEvent observer, VTK will still present a rather user-unfriendly "ChoosePixelFormat failed." message. Ideally, clients of VTK would want to handle the error in their own way. Is there a reason why VTK doesn't simply invoke vtkCommand::ErrorEvent?</div>
<div> </div><div>Best Regards,</div><div>Jenya Burstein</div><div> </div><div>void vtkWin32OpenGLRenderWindow::SetupPixelFormat(HDC hDC, DWORD dwFlags, <br> int debug, int bpp, <br>
int zbpp)</div><div>{<br>....</div><div> pixelFormat = ChoosePixelFormat(hDC, &pfd);<br> if (pixelFormat == 0)<br> {<br>#ifdef UNICODE<br> MessageBox(WindowFromDC(hDC), L"ChoosePixelFormat failed.", L"Error",<br>
MB_ICONERROR | MB_OK);<br>#else<br> MessageBox(WindowFromDC(hDC), "ChoosePixelFormat failed.", "Error",<br> MB_ICONERROR | MB_OK);<br>#endif<br> if (this->HasObserver(vtkCommand::ExitEvent))<br>
{<br> this->InvokeEvent(vtkCommand::ExitEvent, NULL);<br> return;<br> }<br> else<br> {<br> exit(1);<br> }<br> }</div><div>....</div><div>}<br></div>