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. OpenGL and Specific Version Support
Forum Updated to NodeBB v4.3 + New Features

OpenGL and Specific Version Support

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 1.2k Views 3 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.
  • webzoidW Offline
    webzoidW Offline
    webzoid
    wrote on last edited by
    #1

    I have an application which makes use of the QOpenGLWidget.

    I've had reports back from customers that although the software runs (icon in the task bar) there is no display - the window is almost transparent. I've since narrowed this down to the version of OpenGL supported by the end users system but I would like to know:

    1. Is there any way of specifying a version of OpenGL to use in the application. For example, my development is running version 4.4 whereas one of the customers with this issue is only running 3.1. Obviously there are some OpenGL features not supported on the customers system.
    2. How can I determine which features are preventing correct operation of the application? Is it down to a single function call which may not be supported in earlier versions of OpenGL?

    Thanks in advance for any advice.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hi!

      #include "mainwindow.h"
      #include <QApplication>
      #include <QSurfaceFormat>
      #include <QOpenGLContext>
      
      void setSurfaceFormat()
      {
          QSurfaceFormat format;
      #ifdef QT_OPENGL_ES_2
          format.setRenderableType(QSurfaceFormat::OpenGLES);
      #else
          if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) {
              format.setVersion(4, 3); // <-- the minimum version needed goes here
              format.setProfile(QSurfaceFormat::CoreProfile);
          }
      #endif
          format.setDepthBufferSize(24);
          format.setSamples(4);
          format.setStencilBufferSize(8);
          QSurfaceFormat::setDefaultFormat(format);
      }
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          setSurfaceFormat();
      
          MainWindow w;
          w.show();
      
          return a.exec();
      }
      
      1 Reply Last reply
      2
      • webzoidW Offline
        webzoidW Offline
        webzoid
        wrote on last edited by
        #3

        @Wieland thanks for your solution. I will give your code a try now.

        webzoidW 1 Reply Last reply
        0
        • webzoidW webzoid

          @Wieland thanks for your solution. I will give your code a try now.

          webzoidW Offline
          webzoidW Offline
          webzoid
          wrote on last edited by
          #4

          @Wieland Unfortunately this method doesn't seem to work. I used your code, changing the setVersion parameters to 3, 0 however the customer is still having issues with no OpenGL display.

          I've also tried a setVersion(2, 0) which doesn't work, setVersion(1,0) which also doesn't work either. On my local development machine with 4.4, all of the above work fine.

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

            Hi,

            Did you gather the specifics of your customer work station ?
            You might be hitting a driver issue.

            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

            • Login

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