[vtkusers] wxPython and VTK

Mathieu Malaterre mathieu.malaterre at kitware.com
Wed Jan 28 14:26:20 EST 2004


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 <mathieu.malaterre at kitware.com>/* 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 <http://fr.mail.yahoo.com>







More information about the vtkusers mailing list