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. Tearing occurring in my openGL window when using QOpenGLWidget
Qt 6.11 is out! See what's new in the release blog

Tearing occurring in my openGL window when using QOpenGLWidget

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.2k Views 1 Watching
  • 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.
  • K Offline
    K Offline
    kloveridge
    wrote on last edited by
    #1

    I have been working on this problem pretty much all day. I have set up a QOpenGLWidget that serves as a simple openGL viewport to render to. Even if I don't draw content, about 50% of the time when I run the app, the screen will flicker like this:

    !http://i.imgur.com/YhNDr0V.png(OpenGL viewport tearing)!

    Other times, it comes up fine. Has anyone ever seen this?

    At first I thought it was my content drawing. So I turned off drawing everything and it still does it about 50% of the time. I'm setting up the QOpenGLWidget like this:

    @
    QSurfaceFormat format;
    format.setProfile( QSurfaceFormat::CoreProfile );
    format.setDepthBufferSize(24);
    format.setVersion(3,3);
    format.setRenderableType(QSurfaceFormat::OpenGL);
    format.setSwapBehavior(QSurfaceFormat::DefaultSwapBehavior);
    QSurfaceFormat::setDefaultFormat(format);

    ..
    ..

    GLView widget;
    widget.show();
    @

    This is running on a mac.

    1 Reply Last reply
    0
    • B Offline
      B Offline
      billconan
      wrote on last edited by
      #2

      could be graphics driver bug if it doesn't repro on other machines.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kloveridge
        wrote on last edited by
        #3

        The heart of this problem turned out to be QOpenGLWidget. When I switched back to QGLWidget, the problem went away. I pretty certain QOpenGLWidget isn't 100% bug free.

        The trouble I have been having is more related to compiling my application to run on Mac and IOS--which use different shaders. The OpenGL surface has to be configured different to accommodate whichever platform is compiling. It doesn't appear that the QOpenGLWidget is compatible with IOS yet

        1 Reply Last reply
        0
        • B Offline
          B Offline
          billconan
          wrote on last edited by
          #4

          in that case, could you please file a Qt bug? http://bugreports.qt-project.org/

          thank you so much!

          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