Qt Forum

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

    OpenGL in Qt 5.1

    General and Desktop
    2
    3
    1185
    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.
    • R
      rivierakid last edited by

      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

      1 Reply Last reply Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        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.

        (Z(:^

        1 Reply Last reply Reply Quote 0
        • R
          rivierakid last edited by

          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

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