Reputation: 7212
Painting on a QOpenGLFrameBuffer in the Qt 5.3 (beta) seems a bit elusive to me I can get only a black image. (I Haven't tried previous versions of Qt5 but haven't find any notice of some problem in this area)
Searching around I've copied the exact sample at http://dangelog.wordpress.com/2013/02/10/using-fbos-instead-of-pbuffers-in-qt-5-2.
Adding just before the end of createImageWIthFBO()
QImage img=fbo.toImage();
img.save("d:/tmp.jpg");
to inspect the fresh result with no further operations but the resulting image is black.
Am I missing something? perhaps some platform problem? (Win 8.0 here)
Upvotes: 1
Views: 493
Reputation: 7212
The problem was in the instruction format.setMajorVersion(3)
, that 3 should be a 2 and all works as expected. (I guess some implementations of opengl are more picky in this detail)
Upvotes: 1