Render to a file

I was wondering on how to render a scene directly on a file, or on a memory area and then save it to a file, without having to render it on the screen (because I have to render it at hight resolutions to send it to the printer).

Thanx.

Render the scene to a pbuffer, grab the content of the pbuffer and write it to a file.
Regards.

Use Mesa . With OSMesa (Off screen Mesa), you provide your own color buffer for Mesa to render into. Perfect if you want to do something in the background. However, with Mesa, you only haev software rendering, but since you want to save to a file, and file IO is usually a bit slow, I assume speed is not that important.

Thanks guys… I will consifer it, but… what about specifying a bitmap HDC to SetPixelFormat with PFD_DRAW_TO_BITMAP? I am using Borland Builder under Windows.

I am trying this but SetPixelFormat gives me an invalid function error. Any ideas?

Are you calling ChoosePixelFormat before to get a valid pixel format that supports PFD_DRAW_TO_BITMAP?

Got it! I was able to render to a Bitmap by passing the bitmap HDC instead of screen HDC. Thanx to you all guys.