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. OpenGL 3.3 breaking QQuick 2

OpenGL 3.3 breaking QQuick 2

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 1.8k 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.
  • S Offline
    S Offline
    spir
    wrote on last edited by
    #1

    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
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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
      0
      • Z Offline
        Z Offline
        ZapB
        wrote on last edited by
        #3

        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
        0
        • S Offline
          S Offline
          spir
          wrote on last edited by
          #4

          Thanks ZapB, that works for me!

          1 Reply Last reply
          0
          • Z Offline
            Z Offline
            ZapB
            wrote on last edited by
            #5

            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
            0

            • Login

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