Rendering without Display

I’m coding a raytracer but to speed up the process of finding intersections between a ray and a bezier patch or a nurb I want to use OpenGL wich will render the scene and give me the depth-component of it.
But my problem is HOW rendering to a buffer without creating a window , the code would be like that :

for all screen coordinates {
calculate primary ray
for depth=0 to DEPTH_MAX {
.test intersection with spheres,planes and quadrics
.take the depth value of the z-buffer (the incident ray point of view)
.compute reflection ray …
.compute the shading of the closest intersection

Please no win32 tricks (I use HP-UX and Linux)


hajili karim

Any buffer can be used, as long as you can create a rendering context for it.
i.e. OGL is not intended to provide support on buffer management, so it depends strictly on the windowing API.
Take GLUT: the context creation is transparently handled in its internals, but it is relying on the specific API of the platform in which it runs.