Hi, thanks, I found the Pixel Buffers 2 Example.
Thomas Am 24.09.2013 22:24, schrieb Till Oliver Knoll: > Am 24.09.2013 um 16:36 schrieb Bob Hood <bho...@comcast.net>: > >> On 9/24/2013 8:15 AM, Thomas Meyer wrote: >>> Hi, >>> is it possible to use OpenGL and QPainter in one window (Qt 5.1.1)? >>> And if it is possible, how and is it recommended? >>> Example: >>> I want to render the word "Triangle" into the 'OpenGL Window Example' >>> (please see Qt Creator - Welcome - Examples). >>> >>> My first guess is, that it is not possible. I can only render with OpenGL or >>> with QPainter, like the example shows. >> Off the top of my head, have OpenGL render to a buffer, use QPainter to draw >> on the buffer contents, then blit the result to the window. > At least with Qt 4.x there was (at least one) an example which showed how to > "mix" a QPainter with (raw) OpenGL. > > IIRC you always paint on a QGLWidget and the QPainter would translate paint > commands (lines etc.) directly into GL commands, or first paint into a QImage > and convert that into a texture (or the like). > > The magic keywords when switching from/to the GL context to/from the QPainter > context (view, transformation matrix etc.) are > QPainter::begin|endNativePainting, I believe. > > Cheers, > Oliver > _______________________________________________ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest > _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest