QOpenGLFunctions glGetString(GL_EXTENSIONS) is null
Solved
General and Desktop
-
@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;
-
@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);