Qt World Summit: Submit your Presentation

How to draw to front buffer with QOpenGLWidget

  • I am upgrading my application from QGLWidget using Qt 5.3.2 to QOpenGLWidget using QT 5.6.0. The application is upgraded and runs well. However, I am stuck trying to preserve my debugging tools. My development environment is Visual Studio 2013 and even though the final application is using double buffered graphics, for debugging purposes I've written some methods that I could invoke interactively from the debugger, draw into front buffer and see the output on the screen. These functions no longer work because QOpenGLWidget draws to frame buffer. Furthermore, even before attempting to draw when I call glDrawBuffer(GL_FRONT) it generates glError to 1280 (invalid enum). Additional piece of data - glGetIntegerv(GL_DRAW_BUFFER, &my_val) returns 0x8ce0 which is GL_COLOR_ATTACHMENT0 and would make sense with GL 3.0 even though my intent was to limit GL features to 2.0 only.

Log in to reply