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. Cannot turn on overlay plane using OpenGL in Qt5
Forum Updated to NodeBB v4.3 + New Features

Cannot turn on overlay plane using OpenGL in Qt5

Scheduled Pinned Locked Moved Unsolved General and Desktop
openglqt5visual studio
6 Posts 3 Posters 2.0k 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.
  • M Offline
    M Offline
    MikeKit
    wrote on 6 Jul 2018, 00:30 last edited by MikeKit 7 Jun 2018, 00:39
    #1

    We are porting some C++ code from Visual Studio 2008/Qt4 to Visual Studio 2017/Qt5 and cannot turn on the overlay plane using OpenGL 4.5 with a NVIDIA Quadro graphics card. The same code is okay in VS2008/Qt4. Following is a small sample program.

    int main (int argc, char *argv[])
    {
        printf ("debug test1\n");
        QApplication a (argc, argv);
    
        QGLFormat glFmt;
        glFmt.setStereo (true);
        glFmt.setOverlay (true); 
        glFmt.setDoubleBuffer (true);
    
        QGLWidget *qtWid = new QGLWidget (glFmt);
        qtWid->show();
        printf ("version           %d.%d\n", qtWid->format().majorVersion(), qtWid->format().minorVersion());
        printf ("stereo            %d\n",    qtWid->format().stereo());
        printf ("hasOverlay        %d\n",    qtWid->format().hasOverlay());
        printf ("hasOpenGLOverlays %d\n",    qtWid->format().hasOpenGLOverlays());
        printf ("doubleBuffer      %d\n",    qtWid->format().doubleBuffer());
    
        return a.exec ();
    }
    

    In VS2017/Qt5, "hasOverlay" and "hasOpenGLOverlays" always return 0. In VS2008/Qt4 they return 1. The Quadro card has a hardware overlay plane and it is turned on in the NVIDIA Control Panel.

    Did OpenGL in QT5 stop supporting the hardware overlay plane?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 6 Jul 2018, 22:01 last edited by
      #2

      Hi,

      What exact version of Qt 5 are you using ?

      Note that QGLWidget has been deprecated in favour of QOpenGLWidget.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • M Offline
        M Offline
        MikeKit
        wrote on 6 Jul 2018, 23:47 last edited by
        #3

        SGaist,
        Thank you for your reply. I'm using Qt 5.10.1.
        QOpenGLWidget does not appear to have the the set overlay and (or) get overlay functions that QGLWidget had. Am I missing something? I know the trend has moved toward frame buffers objects instead of using the overlay plane. I would like to keep the overlay plane for one of our 3D windows until we get this port complete.
        Thank you for your help,
        Mike

        1 Reply Last reply
        0
        • W Offline
          W Offline
          wrosecrans
          wrote on 7 Jul 2018, 20:40 last edited by
          #4

          Wild guess (I don't have any hardware with true overlay planes handy to try it) but maybe you can set a default surface format before you create the QApplication object that will preserve your desired behavior. If Qt is internally setting up an OpenGL context before your QGLWidget is created, it may be screwing with things.

          I'd try a QSurfaceFormat::setDefaultFormat() with QSurfaceFormat::DeprecatedFunctions set to see if that helps pick up some of the previous behavior. There's nothing explicit in QSurfaceFormat documentation that mentions overlay planes, but you may be able to find some combination of flags that lights them back up. Maybe CompatibilityProfile will help.

          M 1 Reply Last reply 10 Jul 2018, 20:09
          1
          • W wrosecrans
            7 Jul 2018, 20:40

            Wild guess (I don't have any hardware with true overlay planes handy to try it) but maybe you can set a default surface format before you create the QApplication object that will preserve your desired behavior. If Qt is internally setting up an OpenGL context before your QGLWidget is created, it may be screwing with things.

            I'd try a QSurfaceFormat::setDefaultFormat() with QSurfaceFormat::DeprecatedFunctions set to see if that helps pick up some of the previous behavior. There's nothing explicit in QSurfaceFormat documentation that mentions overlay planes, but you may be able to find some combination of flags that lights them back up. Maybe CompatibilityProfile will help.

            M Offline
            M Offline
            MikeKit
            wrote on 10 Jul 2018, 20:09 last edited by MikeKit 7 Oct 2018, 20:11
            #5

            @wrosecrans
            Wrosecrans,

            Thank you for your reply.

            I tried your first suggestion and the overlay plane was still being reported as off. I looked into QSurfaceFormat::DeprecatedFunctions and tried to see if the OpenGL context had the overlay plane turned on but with no luck. Either I'm using OpenGL context wrong or the hardware overlay plane is deprecated. The tell for me is in the QGL source code for the QGLFormat::hasOpenGLOverlays() function as shown below.

            bool QGLFormat::hasOpenGLOverlays()
            {
            return false;
            }

            The hard coded false makes me think that support for hardware overlays is deprecated in Qt although I can't seem to find any documentation that makes that statement.

            We thought there was a trend away from hardware overlays and towards frame buffer objects several years ago and we converted several of our other graphics drivers to use them. It looks like it's time to convert this last holdout and say goodbye to hardware overlays.

            Thank you for your help,
            Mike

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 10 Jul 2018, 20:14 last edited by
              #6

              Before crossing that feature definitively, I'd recommend asking on the interest mailing list. You'll find there Qt's developers/maintainers. This forum is more user oriented.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              1/6

              6 Jul 2018, 00:30

              • Login

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