[Qt-interest] Painting on QGLPixelBuffer

Brad Howes howes at ll.mit.edu
Fri Mar 6 22:56:40 CET 2009


On Mar 6, 2009, at 12:37 PM, Andrea Franceschini wrote:

> What I'm trying to do is to port QGLWidget 2D Painting example to
> QGLPixelBuffer. Basically I need to make the helper paint on a pbuffer
> and use it as a dynamic texture for a GL_QUAD.


First, you may want to forget QGLPixelBuffer and go straight to  
QGLFramebufferObject. Better performance, and a bit easier to work  
with. However, some older graphics card may not support FBOs.

Look at the file glwidget.cpp in examples/opengl/pbuffers2. First,  
something gets drawn into a pbuffer (using an SVG renderer to do the  
drawing). Then,  the OpenGL scene is drawn and the dynamicTexture  
(from the pbuffer) is bound and used from within a drawing list to  
draw the sides of a cube. Pretty easy.

Brad

-- 
Brad Howes
Group 42
MIT Lincoln Laboratory • 244 Wood St. • Lexington, MA 02173
Phone: 781.981.5292 • Fax: 781.981.3495 • Secretary: 781.981.7420








More information about the Qt-interest-old mailing list