[Qt-interest] Painting on QGLPixelBuffer

David Boddie david.boddie at nokia.com
Fri Mar 6 21:02:04 CET 2009


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. I'm trying to discern
> useful parts from the Pixel Buffers Example but I'm working under a
> bit of pressure and I can't really focus on the matter.

After a quick look at the source, I would probably start by inserting the
painting code into the Pixel Buffers 2 Example at this point:

    // render the 'bubbles.svg' file into our pbuffer
    QPainter pbuffer_painter(pbuffer);
    svg_renderer->render(&pbuffer_painter);
    pbuffer_painter.end();
    glFlush();

    [http://doc.trolltech.com/4.5/opengl-pbuffers2-glwidget-cpp.html]

In other words, replace the SVG rendering with the painting code you want
to use.

David
-- 
David Boddie
Senior Technical Writer
Nokia, Qt Software



More information about the Qt-interest-old mailing list