<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2716.2200" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=185034412-10072002><FONT face=Arial
size=2>Hi,</FONT></SPAN></DIV>
<DIV><SPAN class=185034412-10072002><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=185034412-10072002><FONT face=Arial size=2>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.</FONT></SPAN></DIV>
<DIV><SPAN class=185034412-10072002><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=185034412-10072002><FONT face=Arial size=2>The problem is that
when I pop up the vtkImageWindow and then go back to the
vtkWin32OpenGLRenderWindow it is not updated.</FONT></SPAN></DIV>
<DIV><SPAN class=185034412-10072002><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=185034412-10072002><FONT face=Arial size=2>I have been looking
around and think that the problem is as follows :</FONT></SPAN></DIV>
<DIV><SPAN class=185034412-10072002><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=185034412-10072002><FONT face=Arial size=2>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 <SPAN class=185034412-10072002><FONT face=Arial
size=2>vtkWin32OpenGLRenderWindow has become current since the previous call.
This works ok between different vtkWin32OpenGLRenderWindow because they will
change the global variable accordingly.</FONT></SPAN></FONT></SPAN></DIV>
<DIV><SPAN class=185034412-10072002><FONT face=Arial size=2><SPAN
class=185034412-10072002></SPAN></FONT></SPAN> </DIV>
<DIV><SPAN class=185034412-10072002><FONT face=Arial size=2><SPAN
class=185034412-10072002>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 </SPAN></FONT></SPAN><SPAN class=185034412-10072002><FONT face=Arial
size=2><SPAN class=185034412-10072002> wglMakeCurrent as it
should.</SPAN></FONT></SPAN></DIV>
<DIV><SPAN class=185034412-10072002><FONT face=Arial size=2><SPAN
class=185034412-10072002></SPAN></FONT></SPAN> </DIV>
<DIV><SPAN class=185034412-10072002><FONT face=Arial size=2><SPAN
class=185034412-10072002>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.</SPAN></FONT></SPAN></DIV>
<DIV><SPAN class=185034412-10072002><FONT face=Arial size=2><SPAN
class=185034412-10072002></SPAN></FONT></SPAN> </DIV>
<DIV><SPAN class=185034412-10072002><FONT face=Arial size=2><SPAN
class=185034412-10072002>Am I doing something completely wrong or is this a bug
in vtk ?</SPAN></FONT></SPAN></DIV>
<DIV><SPAN class=185034412-10072002><FONT face=Arial size=2><SPAN
class=185034412-10072002></SPAN></FONT></SPAN> </DIV>
<DIV><SPAN class=185034412-10072002><FONT face=Arial size=2><SPAN
class=185034412-10072002>Thanx,</SPAN></FONT></SPAN></DIV>
<DIV><SPAN class=185034412-10072002><FONT face=Arial size=2><SPAN
class=185034412-10072002></SPAN></FONT></SPAN> </DIV>
<DIV><SPAN class=185034412-10072002><FONT face=Arial size=2><SPAN
class=185034412-10072002>Joris</DIV>
<DIV><BR></DIV></SPAN></FONT></SPAN>
<DIV> </DIV>
<DIV align=left><FONT face=Arial size=2></FONT> </DIV>
<DIV align=left>================<BR>Joris Vanden Wyngaerd <BR>coordinates : <A
href="http://www.esat.kuleuven.ac.be/~joris/personalia.html">http://www.esat.kuleuven.ac.be/~joris/personalia.html</A></DIV>
<DIV align=left> </DIV>
<DIV> </DIV></BODY></HTML>