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. QGLWidget always has QGLContext with OpenGL version 1.0 in Qt 4.8.6

QGLWidget always has QGLContext with OpenGL version 1.0 in Qt 4.8.6

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 989 Views 1 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.
  • U Offline
    U Offline
    user00212
    wrote on last edited by
    #1

    I am trying to use a QGLWidget from Qt 4.8.6 to render OpenGL geometry under OS X 10.9.4. However the version number reported by context().format() remains fixed at OpenGL version 1.0.

    "I found this older thread":http://qt-project.org/forums/viewthread/8047 discussing the problem that one can not reach a OpenGL version number higher than 2.1. Unfortunately this seems to be a different and unrelated issue, since i can not even get the context up to version 2.1.

    For testing purposes i use the Core Profile example available from the svn at "the qt-project wiki.":http://qt-project.org/wiki/How_to_use_OpenGL_Core_Profile_with_Qt

    Has anybody encountered this problem before?
    Any hint and pointers are very welcome.

    1 Reply Last reply
    0
    • U Offline
      U Offline
      user00212
      wrote on last edited by
      #2

      It would be great if someone else could verify this behaviour on other machines, to figure out wether or not it is specific to my machine.

      The following code is a minimal example not working for me under OS X (but working under Ubuntu Linux)
      @
      #include <QtOpenGL/QGLFormat>
      #include <QtOpenGL/QGLWidget>
      #include <QtGui/QApplication>
      #include <QtCore/QDebug>

      int main(int argc, char **argv) {
      QApplication app(argc, argv);

      QGLFormat fmt = QGLFormat::defaultFormat();
      fmt.setVersion(3,2);
      fmt.setProfile&#40;QGLFormat::CoreProfile&#41;;
      fmt.setSampleBuffers(true);
      
      QGLWidget c(fmt);
      c.show();
      qDebug() << c.context()->requestedFormat();
      qDebug() << c.context()->format();
      
      return app.exec();
      

      }
      @

      when compiled with

      @
      g++ main.cpp -framework OpenGL -framework QtGui -framework QtCore -framework QtOpenGL -o test
      @

      It prints two lines with QGLFormat dumps. The first is the requested and the second the actually active context format. If everything works as expected they should match. For me the second always looks like this:

      @
      QGLFormat(options QFlags(0x1|0x2|0x4|0x8|0x20|0x80|0x200|0x400) , plane 0 , depthBufferSize 24 , accumBufferSize -1 , stencilBufferSize 8 , redBufferSize -1 , greenBufferSize -1 , blueBufferSize -1 , alphaBufferSize 8 , samples 4 , swapInterval 1 , majorVersion 1 , minorVersion 0 , profile 0 )
      @

      Any help is very much appreciated.

      1 Reply Last reply
      0

      • Login

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