1.8 Double-Buffer-Aware XGetImage
XGetImage
will return a window's visible
pixels, as well as any pixels in inferior or overlapping windows, as long
as their depths are consistent. However, windows created with OpenGL
visuals inherently have different depths due to their ancillary buffers
(back-buffer, Z-buffer, accumulation buffer, stencil planes, etc.). The
contents returned by XGetImage
for these regions are undefined,
as specified by the X Window System. Our implementation will in fact
return the expected results for single-buffered OpenGL visuals, but will
return unexpected results after every other glXSwapBuffers
call for
double-buffered visuals.
The portable way to read the contents of OpenGL buffers is to use the
glReadPixels
call. However, if using XGetImage
to serve this purpose is
desirable, we have provided an option which will return the expected results,
even for inferior or overlapping double-buffered OpenGL windows. The
performance of XGetImage
calls will be negatively impacted with this
option enabled, so it should only be turned on if necessary.
To enable the double-buffer-aware XGetImage
, you must set a device-dependent
command-line argument when invoking the X server:
! PowerStorm 300/350 Server args start
-pn -bs -su -nice -2 -I -riDBAwareGetImage
! PowerStorm 300/350 Server args end
See Sections