View Full Version : Render to a file

09-09-2002, 10:57 PM
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).


09-10-2002, 12:29 AM
Render the scene to a pbuffer, grab the content of the pbuffer and write it to a file.

09-10-2002, 12:34 AM
Use Mesa (http://www.mesa3d.org) . 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.

09-10-2002, 12:45 AM
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?

09-10-2002, 02:25 AM
Are you calling ChoosePixelFormat before to get a valid pixel format that supports PFD_DRAW_TO_BITMAP?

09-10-2002, 04:28 AM
Got it! I was able to render to a Bitmap by passing the bitmap HDC instead of screen HDC. Thanx to you all guys.