Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How can I get actual installed GL version (not GL version being used in current context)?
Forum Updated to NodeBB v4.3 + New Features

How can I get actual installed GL version (not GL version being used in current context)?

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 778 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.
  • C Offline
    C Offline
    cscooper
    wrote on last edited by
    #1

    For debugging I would like to know what GL is installed on the user's machine. I have a QQuickItem that reports the value of glGetString(GL_VERSION); on my machine it says "2.1.2 NVIDIA 304.117" but if I run glxinfo on the command-line it reports "4.2.0 NVIDIA 304.117".

    Is there a way, inside Qt/Qml, to get the "4.2.0" value?

    Thanks,
    Chris

    1 Reply Last reply
    0
    • I Offline
      I Offline
      infinicat
      wrote on last edited by
      #2

      This may not be the best way but what you could try to do is create an OpenGL context using a fake, high version and then check what was actually created.

      In QOpenGLContext's docs:
      "If the OpenGL implementation on your system does not support the requested version of OpenGL context, then QOpenGLContext will try to create the closest matching version."

      Example:
      @QSurfaceFormat requestedFormat;
      requestedFormat.setVersion( 99, 99 );

      QOpenGLContext* context = new QOpenGLContext;
      context->setFormat( requestedFormat );
      context->create();

      qDebug() << QString("Requested OpenGL version (%1.%2); Actual created version (%3.%4).").arg(requestedFormat.majorVersion()).arg(requestedFormat.minorVersion()).arg(context->format().majorVersion()).arg(context->format().minorVersion());@

      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