Skip to content
  • 0 Votes
    22 Posts
    12k Views
    8Observer88

    @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);