Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    OpenGL 3.3 breaking QQuick 2

    General and Desktop
    3
    5
    1550
    Loading More Posts
    • 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.
    • S
      spir last edited by

      I am having trouble setting the version of OpenGL to use to 3.3. I have started a new "Qt Quick 2 Application (Built-in Elements)" from Qt Creator and sub-classed the QtQuick2ApplicationViewer so that I can set the QSurfaceFormat as so:

      @ QSurfaceFormat format;
      format.setMajorVersion(3);
      format.setMajorVersion(3);
      format.setStencilBufferSize(4);
      format.setProfile(QSurfaceFormat::CompatibilityProfile);

      setFormat(format);@
      

      If I run the application nothing is rendered to the window. However, if I change the version to 3.2 or 4.0 then everything seems to render properly. My dev machine is running Ubuntu 13.04 and glxinfo reports:

      bq. OpenGL version string: 4.3.0 NVIDIA 313.30

      I was wondering if anyone could reproduce this in case it is a bug or shed some light on this in case there is something I am missing.

      Thanks!

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi and welcome to devnet,

        This might be a too low-level question for this forum (it's more user oriented) You should try asking on the mailing list, you'll find Qt's developer/maintainers there.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • Z
          ZapB last edited by

          Hmm, that should work. Have you tried something like this?

          @
          QSurfaceFormat f = format();
          f.setVersion(3, 3);
          f.setProfile(QSurfaceFormat::CompatibilityProfile);
          setFormat(f);
          @

          i.e. only changing the parts of the format that you need to change. You are correct in that at present QQ2 requires a compatibility profile. However, OpenGL 3.3 should work fine. I use that here with QQ2 quite a lot. Are you doing any custom OpenGL rendering? If so, try disabling that for now and just using a custom context.

          Nokia Certified Qt Specialist
          Interested in hearing about Qt related work

          1 Reply Last reply Reply Quote 0
          • S
            spir last edited by

            Thanks ZapB, that works for me!

            1 Reply Last reply Reply Quote 0
            • Z
              ZapB last edited by

              Good stuff! Just watch out if you ever port to OS X as there you can only get OpenGL 3.2 Core profile, not compatibility, which won't work with QtQuick2 (yet). So you'd need to fall back to OpenGL 2.1 there. Hopefully we'll get the QtQuick 2 renderer working with the Core profile for Qt 5.2.

              Nokia Certified Qt Specialist
              Interested in hearing about Qt related work

              1 Reply Last reply Reply Quote 0
              • First post
                Last post