OpenGL from 4.8 to 5.0.1



  • 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



  • 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



  • 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.
    @



  • 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.




Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.