Nominate our 2022 Qt Champions!

paintOverlayGL never gets called

  • I've heard that paintGL CAN be called by updateGL but that it is somewhat unpredictable. I assume this is also the case with updateOverlayGL and paintOverlayGL, however, paintOverlayGL never gets called. My test consists of two timers connected to functions paint() and paint_overlay(). The fn paint() calls updateGL() and paint_overlay() calls updateOverlayGL(). Each have a print out and some drawing logic. The background gets drawn but the overlay does not, the printout doesn't even happen.

    Is there some special circumstance paintOverlayGL is reserved for? There's not much in the way of documentation or examples.

  • Lifetime Qt Champion

    Hi and welcome to the forums.
    Please state Qt version and platform so people are aware in what context
    you are talking.
    Just a random thought.
    you did override
    void QGLWidget::initializeOverlayGL() [virtual protected] ?

  • Using qt 5.11 on Windows 7.

    I have overridden initializeOverlayGL() although in searching for solutions I found that overlays need to be specified in the QGLFormat, which I had not done. Trying that now.

  • I have:

    Class::Class(QWidget * parent):
    QGLWidget(QGLFormat(QGL::HasOverlay), parent)
        makeOverlayCurrent();  //trying everything
    void Class::initializeGL()
        // logic
        cout << "entered initialize GL" << endl;
    void Class::initializeOverlayGL()
        // logic
        cout << "entered initializeOverlayGL" << endl;

    First statement prints, second does not. So for some reason it's still not calling initializeOverlayGL() and I'm not sure why.

  • Possibly relevant, from
    "How you access overlay planes depends on the windowing system interface. While GLUT 3.7 has entry points defined for the use of overlays, currently the entry points are disabled. To use overlays, your application needs to use WGL, GLX, or another platform-specific interface."

    I happen to be using GLUT so whatever I was doing wrong, it was bound for failure anyway. Womp.

Log in to reply