OpenGL in Qt 5.1



  • Hi, I'm little bit confused about OpenGL in Qt 5.1 (VS 2012 x64).

    Now I'm using multiple QGLWidgets (shared context, core profile 3.3) and the deprecated classes for shaders (QGLShaderProgram) + GLEW library. Now I'm thinking about rewriting the app using new Qt OpenGL support.

    First I'd tried to replace QGLShaderProgram with the QOpenGLShaderProgram, but I have a problem with my geometry shader. The app is working correctly with QGLShaderProgram, but not with the QOpenglShaderProgram. When there is a geometry shader in usage, glGetError() return invalid operation (no error during compilation and linking).
    Thats really strange. Could it be a conflict between GLEW and the QtOpenglFunction table?

    Second question is about the QWindow class. Should I replace the QGLWidgets with QWindow? There are about 3 QGLWidgets in my app (one central and two in QDockWidget). They share the context (textures, shaders, ...)

    Thanks for help
    Martin


  • Moderators

    Possibly you are using an Angle build of Qt and trying to use OpenGL >2.0 functions? You probably need to compile Qt with "-opengl desktop" option.



  • No,
    qt-windows-opensource-5.1.0-msvc2012_opengl-x86_64-offline.exe
    fca8f6ff98ee4d01a6c8fcfef8e339f6

    BTW I've reported it as a bug:
    https://bugreports.qt-project.org/browse/QTBUG-32243


Log in to reply
 

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