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. Can't get OpenGL version higher than 1.1 on some Win10
Forum Update on Monday, May 27th 2025

Can't get OpenGL version higher than 1.1 on some Win10

Scheduled Pinned Locked Moved Solved General and Desktop
openglangle5.6
7 Posts 2 Posters 3.2k Views
  • 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.
  • L_RaizL Offline
    L_RaizL Offline
    L_Raiz
    wrote on last edited by
    #1

    I am trying to figure out how to assure that my OpenGL desktop application runs on modern Windows computers. The application is built with Qt5.6.2 with an expectation that ANGLE will take care of emulating OpenGL when necessary.

    Before constructing my application I call

    QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL);
    

    My application window (canvas) derives from QOpenGLWindow. In its constructor, I set surface format to

    format.setProfile(QSurfaceFormat::OpenGLContextProfile::CompatibilityProfile);
    format.setRenderableType(QSurfaceFormat::RenderableType::OpenGL);
    

    I don't set OpenGL version and if I check it then the format returns the default GL version 2.0

    I also have a helper class (GLPainter) that is owned by my canvas window and derives from QOpenGLFunctions. When Qt calls initializeGL for my window I do initialization of the helper.

    GLPainter::initialize() 
    {
      canvas()->makeCurrent();
      initializeOpenGLFunctions();
    }
    

    Interesting things happen after a call to makeCurrent(). If I check gl versions using

     QOpenGLContext::currentContext()->format()
    

    on my development machine I would get 4.3 and glGetString(GL_VERSION) after initializeOpenGLFunctions() returns 4.3 as well (note that gl canvas format is still 2.0). My application works okay on my machine.

    I made an installer that includes everything indicated by windeployqt tool. Resulting installer runs okay but the application would not run on some computers. By adding diagnostic print statements I discovered that on those computers my canvas()->format() still reports 2.0 but QOpenGLContext::currentContext()->format() is 1.1 and correspondently openGL functions are limited to 1.1 only and as a consequence the application would not run. The troubled computer is a 64bit Windows 10 and it has DirectX 12.

    I don't know enough to make further progress and would appreciate suggestions.

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

      Hi,

      AFAIK, if you set the AA_UseDesktopOpenGL attribute, you are short-circuiting the dynamic OpenGL backend selection so you won't have ANGLE kicking in.

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

      L_RaizL 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        AFAIK, if you set the AA_UseDesktopOpenGL attribute, you are short-circuiting the dynamic OpenGL backend selection so you won't have ANGLE kicking in.

        L_RaizL Offline
        L_RaizL Offline
        L_Raiz
        wrote on last edited by
        #3

        @SGaist Thanks for your response. Does it mean that on some computers (graphics cards) I would not get features of OpenGL 2.0?

        If the answer is yes then how do I check for this situation and possibly switch to a software implementation of OpenGL (I can live within confinements of 2.0)

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          It's unlikely but not impossible however that would be really old hardware.

          What are the specs of the machine you have that situation on ?

          Note that you should also ensure to have proper graphic card driver installed.

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

          L_RaizL 1 Reply Last reply
          0
          • SGaistS SGaist

            It's unlikely but not impossible however that would be really old hardware.

            What are the specs of the machine you have that situation on ?

            Note that you should also ensure to have proper graphic card driver installed.

            L_RaizL Offline
            L_RaizL Offline
            L_Raiz
            wrote on last edited by
            #5

            @SGaist Right you are. The computer in question is circa 2009. Unfortunately, my attempts to update graphics drivers on this machine failed. Qt documentation seems to imply that at least GL 2.0 is always supported (possibly via ANGLE). I hope this is true on computers that are less than 5-year-old. Thanks.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              It's really a question of driver rather than hardware age. As long as it supports DirectX 9 at least (like described here), you should be good to go.

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

              L_RaizL 1 Reply Last reply
              0
              • SGaistS SGaist

                It's really a question of driver rather than hardware age. As long as it supports DirectX 9 at least (like described here), you should be good to go.

                L_RaizL Offline
                L_RaizL Offline
                L_Raiz
                wrote on last edited by
                #7

                @SGaist My experience is different. The computer reported having DirectX 12 but it didn't work. Anyway, I am no longer worried about this particular computer.
                Thanks

                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