[vtk-developers] calling XMapWindow in offscreen mode
Joe Miller
lpe540 at yahoo.com
Thu Oct 1 09:14:30 EDT 2009
Hi,
I was playing with non-mesa offscreen rendering (ie using x to offscreen render) and I noticed that my window still appeared. I know that the documentation says that offscreen mode may not be supported by all windows; however, I also noticed that XMapWindow is called even in offscreen mode. I was curious if this was necessary? I added a conditional around the call (and a few related lines beneith it) in my local copy of vtk and that seems to fix the problem. I'm not a strong x programmer, so I didn't want to put in an official bug without checking around first.
I've tested it on mac OS X, Solaris 10 and Red Hat 5 machines. I'm using vtk 5.4.2. The file affected is vtkXOpenGLRenderWindow.cxx, revision 1.102
I added the conditional at line 641 which encompasses lines 642-654
if(!this->OffScreenRendering)
{
XMapWindow(this->DisplayId, this->WindowId);
XSync(this->DisplayId,False);
XGetWindowAttributes(this->DisplayId,
this->WindowId,&winattr);
// guarantee that the window is mapped before the program continues
// on to do the OpenGL rendering.
while (winattr.map_state == IsUnmapped)
{
XGetWindowAttributes(this->DisplayId,
this->WindowId,&winattr);
}
}
I appreciate the feedback.
Thanks
-joe
More information about the vtk-developers
mailing list