PDA

View Full Version : Background rendering?



tbc++
06-10-2004, 10:11 AM
Is there any way to render a scene, capture the framebuffer back into system memory and save it to the disk, all without actualy displaying a window on the desktop?

VWeeks
06-10-2004, 10:16 AM
Originally posted by tbc++:
Is there any way to render a scene, capture the framebuffer back into system memory and save it to the disk, all without actualy displaying a window on the desktop?If you have the data in memory, why not create a bitmap in the file format of your choice? There are lots of freeware file writer/readers out there.

tbc++
06-10-2004, 10:19 AM
What I want to do is be able to render the image without displaying a window on the desktop. Kindof a "silent" render.

jwatte
06-10-2004, 11:56 AM
You can attach a context to a window, render, and read back the back buffer without ever calling SwapBuffers(). However, this will not work right when the window is partially or wholly obscured.

What you really should do is create a pbuffer, and create a context on that, and render and read back.

charliejay
06-11-2004, 12:23 AM
Thus far, I only program on Mac, so I don't know too much about other OSes/windowing systems, but on OS X, there's an OFFSCREEN attribute you can use when creating a context for doing exactly this - surely the other systems would have something similar?

PfhorSlayer
06-11-2004, 03:24 PM
Originally posted by charliejay:
Thus far, I only program on Mac, so I don't know too much about other OSes/windowing systems, but on OS X, there's an OFFSCREEN attribute you can use when creating a context for doing exactly this - surely the other systems would have something similar?Unless speed is a non-issue, do NOT go this route. NONE of the offscreen renderers for OS X are hardware accelerated; they're all done in software. However, an offscreen renderer allows you to specify the memory region that the buffer is written to, so that makes it easier to get the pixels when you're done.

Check out pbuffers, they should be able to do what you want to do.