Qt Forum

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

    OpenGL from 4.8 to 5.0.1

    General and Desktop
    2
    5
    5253
    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.
    • A
      AlricDoRei last edited by

      I am trying to compile my application using Qt 5.0.1 (mingw4_7).
      6 errors something like:
      'GLdouble' has a previous declaration as 'typedef double GLdouble'

      and about 300 warnings:
      GL_FALSE redefined, etc.

      The same problem with Qt 5.0.0

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

        Sounds like an OpenGL desktop vs OpenGL ES 2 issue to me. The Qt5 pre-compiled packages are built against ANGLE at present which provides OpenGL ES 2. If you then #include <GL/gl.h> or similar you will get conflicting definitions.

        If you wish to use desktop OpenGL on windows with Qt 5 it is necessary to rebuild Qt yourself passing in -opengl desktop to the configure.bat script.

        This will hopefully be resolved in Qt 5.0.2 where binaries built against desktop OpenGL will be shipped too. Please vote for https://bugreports.qt-project.org/browse/QTBUG-28715

        Nokia Certified Qt Specialist
        Interested in hearing about Qt related work

        1 Reply Last reply Reply Quote 0
        • A
          AlricDoRei last edited by

          I have compiled Qt 5.0.1 with -opengl desktop.
          I solved the problem, and got another one.

          Qt reports wrong version (2.1).
          I have added:
          @
          format.setVersion(4,3);
          format.setProfile(QGLFormat::CompatibilityProfile);
          @
          Now qt reports 4.3 version.

          I can't change the swap interval. It is always = -1
          @
          format.setSwapInterval(0) // It doesn't work.
          @

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

            A default constructed QGLFormat (or QSurfaceFormat for that matter) defaults to OpenGL 2.x as that is what QtQuick2 uses. As you found, you can request specific versions and if your card and driver supports it you will get that version back.

            For the swap interval I am not sure. Have you tried a swap interval of 1? You may have to step into the windows qpa plugin to see what it is doing. I can't recall off the top of my head.

            Nokia Certified Qt Specialist
            Interested in hearing about Qt related work

            1 Reply Last reply Reply Quote 0
            • A
              AlricDoRei last edited by

              https://bugreports.qt-project.org/browse/QTBUG-29073

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