[vtkusers] wxPython and VTK

REGAT-BARREL Aurélien arbvtk at yahoo.fr
Wed Jan 28 14:13:20 EST 2004


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040128/e64f6bbb/attachment.htm>


More information about the vtkusers mailing list