Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. paintOverlayGL never gets called

paintOverlayGL never gets called

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 679 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    qwertyuiop
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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] ?

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qwertyuiop
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        1
        • Q Offline
          Q Offline
          qwertyuiop
          wrote on last edited by qwertyuiop
          #4

          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.

          1 Reply Last reply
          0
          • Q Offline
            Q Offline
            qwertyuiop
            wrote on last edited by
            #5

            Possibly relevant, from openGL.org:
            "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.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved