Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-38063

Windows: QWindowsOpenGLContextFormat::current() relies on glGetString(GL_VERSION) which returns null in some circumstances

    XMLWordPrintable

    Details

    • Commits:
      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.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            kleint Friedemann Kleint
            Reporter:
            andysh Andy Shaw
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes