<DIV>Hello,</DIV>
<DIV>Yes I have 2 render windows, but during my test I have not initialized the second (empty window).</DIV>
<DIV>So I will keep the solution of cleaning all object.</DIV>
<DIV>For information, here is the code I use :</DIV>
<DIV> </DIV>
<DIV> renderers = self.wxVTKRenWin1.GetRenderWindow().GetRenderers()<BR> numRenderers = renderers.GetNumberOfItems()</DIV>
<DIV> renderers.InitTraversal()<BR> for i in range(0,numRenderers):<BR> renderer = renderers.GetNextItem()<BR> renderer.RemoveAllProps()<BR><BR><BR><B><I>Mathieu Malaterre <mathieu.malaterre@kitware.com></I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Aurélien<BR><BR>Do you use two render windows ? Anyway you should use the other <BR>solution while I try to fix this problem. Thanks a lot this was very <BR>usefull.<BR><BR>Mathieu<BR><BR>REGAT-BARREL Aurélien wrote:<BR>> Hello,<BR>> I have updated my vtkWin32OpenGLRenderWindow (lines where not the same <BR>> at all). My app doesn't crash anymore but I have a VTK error instead :<BR>> <BR>> wglMakeCurrent failed in MakeCurrent(), error: Invalid descriptor<BR>> wglMakeCurrent failed in Clean(), error: 6<BR>> <BR>> Here is the location :<BR>> <BR>> void vtkWin32OpenGLRenderWindow::MakeCurrent()<BR>> {<BR>> // Try to avoid doing anything (for performance).<BR>> HGLRC current = wglGetCurrentContext();<BR>> if (this->ContextId != current)<BR>> {<BR>> if(this->IsPicking && current)<BR>> {<BR>> vtkErrorMacro("Attempting to
call MakeCurrent for a different window"<BR>> " than the one doing the picking, this can causes <BR>> crashes"<BR>> " and/or bad pick results");<BR>> }<BR>> else<BR>> {<BR>> if (wglMakeCurrent(this->DeviceContext, this->ContextId) != TRUE)<BR>> {<BR>> LPVOID lpMsgBuf;<BR>> ::FormatMessage(<BR>> FORMAT_MESSAGE_ALLOCATE_BUFFER |<BR>> FORMAT_MESSAGE_FROM_SYSTEM |<BR>> FORMAT_MESSAGE_IGNORE_INSERTS,<BR>> NULL,<BR>> GetLastError(),<BR>> MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language<BR>> (LPTSTR) &lpMsgBuf,<BR>> 0,<BR>> NULL<BR>> );<BR>> vtkErrorMacro("wglMakeCurrent failed in MakeCurrent(), error: "<BR>> << (LPCTSTR)lpMsgBuf);<BR>> ::LocalFree( lpMsgBuf );<BR>> }<BR>> }<BR>> }<BR>> }<BR>> <BR>> called in vtkWin32OpenGLRenderWindow::Clean()<BR>> <BR>> if (wglMakeCurrent(NULL, NULL) != TRUE)<BR>> {<BR>> vtkErrorMacro("wglMakeCurrent failed in Clean(), error: "
<< <BR>> GetLastError());<BR>> }<BR>> <BR>> <BR>> */Mathieu Malaterre <MATHIEU.MALATERRE@KITWARE.COM>/* wrote:<BR>> <BR>> Aurélien,<BR>> <BR>> You shouldn't be doing something particular for Windows. I recently<BR>> commited a patch for that -or I believe so-. Could you do me a favor,<BR>> could you please try it instead of the<BR>> <BR>> 'self.renderer.GetProps().RemoveAllItems()'<BR>> <BR>> Go to that web page, it works just like a patch :<BR>> <BR>> http://vtk.org/cgi-bin/cvsweb.cgi/VTK/Rendering/vtkWin32OpenGLRenderWindow.cxx.diff?r1=1.121&r2=1.122<BR>> <BR>> And just apply the same modification to your local VTK build tree. (you<BR>> don't need a particular revision of vtkWin32OpenGLRenderWindow.cxx).<BR>> <BR>> Thanks a bunch<BR>> Mathieu<BR>> <BR>> <BR>> ------------------------------------------------------------------------<BR>> Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en
français !<BR>> Testez le nouveau Yahoo! Mail <HTTP: fr.mail.yahoo.com><BR><BR><BR><BR><BR>_______________________________________________<BR>This is the private VTK discussion list. <BR>Please keep messages on-topic. Check the FAQ at: <HTTP: vtkfaq cgi-bin public.kitware.com><BR>Follow this link to subscribe/unsubscribe:<BR>http://www.vtk.org/mailman/listinfo/vtkusers</BLOCKQUOTE><p><br><hr size=1><font face=arial size=-1>Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !<br>
<a href=http://fr.mail.yahoo.com>Testez le nouveau Yahoo! Mail</a></font>