[vtkusers] wxPython and VTK

REGAT-BARREL Aurélien arbvtk at yahoo.fr
Wed Jan 28 18:01:10 EST 2004


Hello,
Yes I have 2 render windows, but during my test I have not initialized the second (empty window).
So I will keep the solution of cleaning all object.
For information, here is the code I use :
 
        renderers = self.wxVTKRenWin1.GetRenderWindow().GetRenderers()
        numRenderers = renderers.GetNumberOfItems()
        renderers.InitTraversal()
        for i in range(0,numRenderers):
            renderer = renderers.GetNextItem()
            renderer.RemoveAllProps()


Mathieu Malaterre <mathieu.malaterre at kitware.com> wrote:
Aurélien

Do you use two render windows ? Anyway you should use the other 
solution while I try to fix this problem. Thanks a lot this was very 
usefull.

Mathieu

REGAT-BARREL Aurélien wrote:
> Hello,
> I have updated my vtkWin32OpenGLRenderWindow (lines where not the same 
> at all). My app doesn't crash anymore but I have a VTK error instead :
> 
> wglMakeCurrent failed in MakeCurrent(), error: Invalid descriptor
> wglMakeCurrent failed in Clean(), error: 6
> 
> Here is the location :
> 
> void vtkWin32OpenGLRenderWindow::MakeCurrent()
> {
> // Try to avoid doing anything (for performance).
> HGLRC current = wglGetCurrentContext();
> if (this->ContextId != current)
> {
> if(this->IsPicking && current)
> {
> vtkErrorMacro("Attempting to call MakeCurrent for a different window"
> " than the one doing the picking, this can causes 
> crashes"
> " and/or bad pick results");
> }
> else
> {
> if (wglMakeCurrent(this->DeviceContext, this->ContextId) != TRUE)
> {
> LPVOID lpMsgBuf;
> ::FormatMessage(
> FORMAT_MESSAGE_ALLOCATE_BUFFER |
> FORMAT_MESSAGE_FROM_SYSTEM |
> FORMAT_MESSAGE_IGNORE_INSERTS,
> NULL,
> GetLastError(),
> MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
> (LPTSTR) &lpMsgBuf,
> 0,
> NULL
> );
> vtkErrorMacro("wglMakeCurrent failed in MakeCurrent(), error: "
> << (LPCTSTR)lpMsgBuf);
> ::LocalFree( lpMsgBuf );
> }
> }
> }
> }
> 
> called in vtkWin32OpenGLRenderWindow::Clean()
> 
> if (wglMakeCurrent(NULL, NULL) != TRUE)
> {
> vtkErrorMacro("wglMakeCurrent failed in Clean(), error: " << 
> GetLastError());
> }
> 
> 
> */Mathieu Malaterre /* wrote:
> 
> Aurélien,
> 
> You shouldn't be doing something particular for Windows. I recently
> commited a patch for that -or I believe so-. Could you do me a favor,
> could you please try it instead of the
> 
> 'self.renderer.GetProps().RemoveAllItems()'
> 
> Go to that web page, it works just like a patch :
> 
> http://vtk.org/cgi-bin/cvsweb.cgi/VTK/Rendering/vtkWin32OpenGLRenderWindow.cxx.diff?r1=1.121&r2=1.122
> 
> And just apply the same modification to your local VTK build tree. (you
> don't need a particular revision of vtkWin32OpenGLRenderWindow.cxx).
> 
> Thanks a bunch
> Mathieu
> 
> 
> ------------------------------------------------------------------------
> Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
> Testez le nouveau Yahoo! Mail 




_______________________________________________
This is the private VTK discussion list. 
Please keep messages on-topic. Check the FAQ at: 
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers


---------------------------------
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Testez le nouveau Yahoo! Mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040129/d67a44fa/attachment.htm>


More information about the vtkusers mailing list