[vtkusers] problem with MakeCurrent in vtkImageWindow and vtkWin32OpenGLRenderWindow

joris Joris.VandenWyngaerd at esat.kuleuven.ac.be
Wed Jul 10 08:57:08 EDT 2002


Hi,
 
I integrated vtk in an MFC application. In my MFC view I show some 3D
scenes with vtkWin32OpenGLRenderWindow. I now made a dialog class that
pops up modeless showing a 2D image vtkImageWindow.
 
The problem is that when I pop up the vtkImageWindow and then go back to
the vtkWin32OpenGLRenderWindow it is not updated.
 
I have been looking around and think that the problem is as follows :
 
When vtkWin32OpenGLRenderWindow renders, it makes itself current with
vtkWin32OpenGLRenderWindow::MakeCurrent(). In this function the global
variable vtkWin32OpenGLGlobalContext is set to avoid calling
wglMakeCurrent when no other vtkWin32OpenGLRenderWindow has become
current since the previous call. This works ok between different
vtkWin32OpenGLRenderWindow because they will change the global variable
accordingly.
 
I think the problem is that vtkWin32OpenGLImageWindow::MakeCurrent()
does not change the variable as it should. Then when I activate the
vtkWin32OpenGLRenderWindow, vtkWin32OpenGLRenderWindow::MakeCurrent() is
called, but it notices that the global variable is still the same and
does not call   wglMakeCurrent as it should.
 
I found a hack to make my program behave as it should. In the imaging
dialog I put a dummy vtkWin32OpenGLRenderWindow that on which I call
MakeCurrent after drawing the image, forcing a change in the global
variable.
 
Am I doing something completely wrong or is this a bug in vtk ?
 
Thanx,
 
Joris

 
================
Joris Vanden Wyngaerd 
coordinates : http://www.esat.kuleuven.ac.be/~joris/personalia.html
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20020710/e5e24a78/attachment.htm>


More information about the vtkusers mailing list