PDA

View Full Version : Buffer copying ?



samhaz
06-15-2010, 05:06 AM
Hi everyone. I'm trying to create a 'paint' style application that I need to overlay coordinate information onto. I'm currently drawing to the back buffer, and swapping buffers every 16ms (it's for a touchscreen demonstration). The back buffer doesn't get cleared....ever, because it's constantly being updated with new information. Can someone please point me in the right direction on the best way to overlay my coordinate info, I would be very grateful. My current thoughts are to render all drawing to AUX1, copy AUX1 to the back buffer, render my coordinate info there, then swap buffers. Is this the best way of doing it (and where do I even begin to do that ? lol) - Thanks.

Jan
06-15-2010, 06:07 AM
No, that's definitely painful.

Use "Framebuffer Objects" (FBOs). An extension to do proper render-to-texture. See here. (http://www.opengl.org/registry/specs/ARB/framebuffer_object.txt)

If you have never used extension before, get glew. (http://glew.sourceforge.net/)

Searching for "framebuffer object" should give you several tutorials that explain how to use it. Once you understood it, it is really easy.

Hope that helps,
Jan.

samhaz
06-15-2010, 06:28 AM
Cool, will look up framebuffer object now and let you know how I get on. Thanks Jan for the pointer.