<font size="3" face="Times New Roman">
</font><div style="margin: 0in 0in 0pt;" class="MsoNormal"><span style="color: rgb(31, 73, 125); mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2;"><font size="3"><font face="Calibri">It appears that VTK doesn’t support handling
of OpenGL failures. At least in the context of trying to enable offscreen
rendering. Even if I prevent VTK from exitting the application, it presses
on with attempting to initialize the OpenGL context after a failure occurred.
That eventually blows with a dereference of a NULL pointer. </font></font></span></div><div style="margin: 0in 0in 0pt;" class="MsoNormal"><span style="color: rgb(31, 73, 125); mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2;"><font size="3"><font face="Calibri"></font></font></span> </div>
<div style="margin: 0in 0in 0pt;" class="MsoNormal"><span style="color: rgb(31, 73, 125); mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2;"><font size="3"><font face="Calibri">Is that a known issue? Should an attempt to be made to support OpenGL failures more gracefully?</font></font></span></div>
<div style="margin: 0in 0in 0pt;" class="MsoNormal"><span style="color: rgb(31, 73, 125); mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2;"><font size="3" face="Calibri"></font></span> </div>
<div style="margin: 0in 0in 0pt;" class="MsoNormal"><span style="color: rgb(31, 73, 125); mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2;"><font size="3" face="Calibri">Any advice is much appreciated,</font></span></div>
<div style="margin: 0in 0in 0pt;" class="MsoNormal"><span style="color: rgb(31, 73, 125); mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2;"><font size="3" face="Calibri">Jenya Burstein</font></span></div>
<div><font size="3" face="Times New Roman">
</font><br><br></div><div class="gmail_quote">On Wed, Aug 17, 2011 at 5:10 PM, Jenya Burstein <span dir="ltr"><<a href="mailto:taijinian@gmail.com">taijinian@gmail.com</a>></span> wrote:<br><blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;" class="gmail_quote">
<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>
</blockquote></div><br>