In this case, the application is responsible for computing the color value of each pixel. The Opengl Programming Guide, Third Edition , describes some techniques for displaying the results of CSG operations on geometric data. The GLUT 3.7 distribution contains an example program called csg.c that may be informative. OpenGL contains no direct support for collision detection. Your application needs to perform this operation itself.
Visible primitives are potential collision candidates.
You can examine their Z values to determine range. I understand OpenGL might cache commands in an internal buffer. After you issue OpenGL commands, inevitably they'll be executed. The OpenGL spec allows an implementation to store commands and data in buffers, which are awaiting execution. OpenGL currently provides no services for printing.