diff options
author | Samuel Rødal <[email protected]> | 2012-09-13 20:50:59 +0200 |
---|---|---|
committer | The Qt Project <[email protected]> | 2012-09-27 18:35:55 +0200 |
commit | ccf0669da933e519edcff03698643e906b5935d5 (patch) | |
tree | 7c5d7880f0ef8755aebf9a653eff0a9004330c8c /examples/opengl/pbuffers/main.cpp | |
parent | 2d70dde68a1af355ae10cd6bd34f44006f16918a (diff) |
Added QGLPixelBuffer implementation using framebuffer objects.
Instead of having QGLPixelBuffer be a unusable stub implementation we
deprecate it and implement it in terms of QOpenGLFramebufferObject.
Framebuffer objects are anyway the recommended replacement for
pixelbuffers in modern OpenGL, as the context switching overhead is
avoided.
Change-Id: Ia220c358ee92813e87981d297c51d84525010322
Reviewed-by: Sean Harmer <[email protected]>
Diffstat (limited to 'examples/opengl/pbuffers/main.cpp')
-rw-r--r-- | examples/opengl/pbuffers/main.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/opengl/pbuffers/main.cpp b/examples/opengl/pbuffers/main.cpp index 6ae4542ca6e..58d25245a1c 100644 --- a/examples/opengl/pbuffers/main.cpp +++ b/examples/opengl/pbuffers/main.cpp @@ -49,14 +49,16 @@ int main(int argc, char **argv) Q_INIT_RESOURCE(pbuffers); QApplication a(argc, argv); + GLWidget widget(0); + widget.resize(640, 480); + widget.makeCurrent(); + if (!QGLFormat::hasOpenGL() || !QGLPixelBuffer::hasOpenGLPbuffers()) { QMessageBox::information(0, "OpenGL pbuffers", "This system does not support OpenGL/pbuffers."); return -1; } - GLWidget widget(0); - widget.resize(640, 480); widget.show(); return a.exec(); } |