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. Qt + OpenGL: pictures in OpenGL widgets swap.
Forum Updated to NodeBB v4.3 + New Features

Qt + OpenGL: pictures in OpenGL widgets swap.

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 1.9k Views 3 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.
  • T Offline
    T Offline
    Teh Me
    wrote on 9 Jun 2016, 13:16 last edited by
    #1

    Hello. I have an application that renders multiple OpenGL 'screens'. in multiple windows. Image data for screens is in YUV colorspace. Shaders translate it to RGB. For each screen I use 3 textures: for Y, U and V respectively, and combine them in shader.
    When have 2 windows and add 1 screen to each one, pictures in screens start swapping randomly. It does not happen when I use 1 texture (for example, just drawing RGB images).
    Unfortunately, I can't reproduce this issue in a sketch application. Please give me some hint where I can find info about this issue. Can Qt be involved in this issue, or is it OpenGL or me?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 9 Jun 2016, 21:29 last edited by
      #2

      Hi and welcome to devnet,

      If you can't reproduce that in a "dummy" application, then it's likely that you are doing something wrong. However without seeing any code it's pretty difficult to tell you what might be going wrong. Did you check that your context are always current ? Are you sharing one context across several widgets ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • T Offline
        T Offline
        Teh Me
        wrote on 20 Jun 2016, 14:38 last edited by
        #3

        Hello, SGaist. Sorry for my late answer.
        Contexts of corresponding widgets are always current at the time of drawing (in paintGL()). And they are always different for different widgets. I did not share them explicitly, can there be any implicit sharing?
        I will try to reproduce the issue again. If I succeed, I will post the code.
        If you have more ideas what can I check, post them, please. Thank you.

        1 Reply Last reply
        0
        • T Offline
          T Offline
          Teh Me
          wrote on 21 Jun 2016, 15:48 last edited by
          #4

          @SGaist, take a look please.
          I reproduced the issue successfully.
          This is the example application.
          To reproduce the issue start the application, open .yuv files in each window, then move mouse from and to button several times in any window. OpenGL widget will show a frame from other file.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 21 Jun 2016, 20:05 last edited by
            #5

            Sorry, my current system doesn't provide that OpenGL profile currently.

            In any case, what kind of YUV image is it ? 4:4:4 ? 4:2:2 ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • T Offline
              T Offline
              Teh Me
              wrote on 23 Jun 2016, 14:54 last edited by
              #6

              @SGaist, files in project are in YV12 format.
              Here is the video of what is happening.
              First, I open yuvnumbers1 file (white background) in first window. Next, I open yuvnumbers2 file (green background) in second window. Pictures swap immediately. Then I move mouse cursor from and to open button (cursor is not seen, but button becomes highlighted), and pictures swap again for a moment. Same for other window.
              Sometimes video in window that opened file second just freezes. UpdateRequest events are received, but Paint events occur only when I move the cursor over button, or move the window.

              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