PDA

View Full Version : glut offscreen rendering



John Qualis
10-05-2010, 11:02 PM
Any examples available for using glut/freeglut for off-screen rendering? One way is to use FBO and a dummy glut window bound to a depth FBO, swap and hide the window. Is there a better way of doing it - without creating a dummy window?
I am interested in all available exmaples of off-screen rendering.
Thanks in advance.

Dark Photon
10-06-2010, 04:08 PM
Any examples available for using glut/freeglut for off-screen rendering? One way is to use FBO and a dummy glut window bound to a depth FBO, swap and hide the window. Is there a better way of doing it - without creating a dummy window?
With GLUT? Never done it or heard it done. I'd grab the freeglut source and look for GLX_DRAWABLE_TYPE. You want to see if it allows a path to set this to something besides GLX_WINDOW_BIT (e.g. GLX_PIXMAP_BIT or GLX_PBUFFER_BIT). If not, short of modifying GLUT and submitting the changes, something like what you're doing might be the only option. Of course, it's not that hard to just create a prog that uses glX or wgl. There are examples out there to copy and tweak from.