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. QOpenGLFunctions glGetString(GL_EXTENSIONS) is null
Forum Updated to NodeBB v4.3 + New Features

QOpenGLFunctions glGetString(GL_EXTENSIONS) is null

Scheduled Pinned Locked Moved Solved General and Desktop
qt5.5openglqopenglfunctioncontextglextensions
22 Posts 4 Posters 13.1k Views 4 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.
  • 8 Offline
    8 Offline
    8Observer8
    wrote on 28 Oct 2020, 12:16 last edited by
    #21

    @Chris-Kawa said in QOpenGLFunctions glGetString(GL_EXTENSIONS) is null:

    QString exts = QString::fromLatin1((const char*)ctx.functions()->glGetString(GL_EXTENSIONS)).replace(" ", "\n\t");

    I have a same question. I try to show OpenGL version but I get empty string:

        QString version = QString::fromLatin1((const char*)glGetString(GL_VERSION));
        qDebug() << version;
    
    8 1 Reply Last reply 28 Oct 2020, 12:20
    0
    • 8 8Observer8
      28 Oct 2020, 12:16

      @Chris-Kawa said in QOpenGLFunctions glGetString(GL_EXTENSIONS) is null:

      QString exts = QString::fromLatin1((const char*)ctx.functions()->glGetString(GL_EXTENSIONS)).replace(" ", "\n\t");

      I have a same question. I try to show OpenGL version but I get empty string:

          QString version = QString::fromLatin1((const char*)glGetString(GL_VERSION));
          qDebug() << version;
      
      8 Offline
      8 Offline
      8Observer8
      wrote on 28 Oct 2020, 12:20 last edited by 8Observer8
      #22

      @8Observer8 said in QOpenGLFunctions glGetString(GL_EXTENSIONS) is null:

      I have a same question. I try to show OpenGL version but I get empty string:

      I solved the problem. I activated a second video card on my laptop from code in main.cpp:

      #ifdef _WIN32
      #include <windows.h>
      extern "C" __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
      extern "C" __declspec(dllexport) DWORD AmdPowerXpressRequestHighPerformance = 0x00000001;
      #endif
      
      #include "Widget.h"
      
      #include <QApplication>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          Widget w;
          w.show();
          return a.exec();
      }
      

      It works too (without QString::fromLatin1):

      qDebug() << (const char*)glGetString(GL_VERSION);
      
      1 Reply Last reply
      0

      21/22

      28 Oct 2020, 12:16

      • Login

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