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. QOpenGLContext for OpenGL version 3.3

QOpenGLContext for OpenGL version 3.3

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.3k Views
  • 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.
  • Z Offline
    Z Offline
    Zajo
    wrote on 1 Sept 2014, 06:19 last edited by
    #1

    I'm running OS X 10.9.4 and Qt 5.3.1. I need to create a QOpenGLContext that uses Open GL 3.3. My system reports 100% compatibility with OpenGL 3.3, however I am getting a context that supports 2.1 only. As well, calling versionFunctions<QOpenGLFunctions_3_3_Core>() returns 0.

    What is the correct modification to, say, the OpenGL Window Example (http://qt-project.org/doc/qt-5/qtgui-openglwindow-example.html) that makes it possible to use OpenGL 3.3? I've tried to set the desired version on the QSurfaceFormat, but I haven't been able to make it work on this system (on Windows, I get a context with OpenGL version that matches the highest supported by that system -- by default.)

    Thanks,
    Emil

    1 Reply Last reply
    0
    • A Offline
      A Offline
      agocs
      wrote on 2 Sept 2014, 08:23 last edited by
      #2

      Which profile? Asking for version 2.0, 2.1 or a compatibility profile of 3.2+ you will often get a context for a higher version (compat profile of course) since this is compatible with what you have requested.

      Core profile is a different story.
      Do
      format.setVersion(3, 3);
      format.setProfile(QSurfaceFormat::CoreProfile);
      to request a 3.3 core profile.

      Note that the example in question may not function in such a setup since it may not be prepared to handle core profiles (that do not support the old-style shaders, require VAOs, disallow client-side pointers, etc.)

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        Zajo
        wrote on 2 Sept 2014, 18:22 last edited by
        #3

        Thank you, I was missing the call to setProfile(QSurfaceFormat::CoreProfile).

        1 Reply Last reply
        0

        1/3

        1 Sept 2014, 06:19

        • Login

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