Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.2.1
-
229c98abf0069e181704c6db9043f0cec00eff97 (stable, 10.4.2014, 5.3)
Description
Windows: QWindowsOpenGLContextFormat::current() relies on glGetString(GL_VERSION) which returns null in some circumstances. For example the following:
#include <QApplication> #include <QByteArray> #include <QDebug> #include <QtOpenGL> int main(int argc, char **argv) { QApplication a(argc, argv); const GLubyte *s = glGetString(GL_VERSION); qDebug() << QByteArray((const char *)s); return 0; }
will return a valid version with 32bit mode but not on 64bit mode on Windows 7. When a valid context exists then it will work fine. Therefore there should be a check in current() to ensure that a temporary context is created if it originally returns null to force it's hand.