Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QQuickFramebufferObject::Renderer and FBO reading
Forum Updated to NodeBB v4.3 + New Features

QQuickFramebufferObject::Renderer and FBO reading

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 597 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.
  • E Offline
    E Offline
    esban
    wrote on last edited by
    #1

    I'm trying to port a QT widgets application to QML. My application has an OpenGL view where i draw some 2D graphics.

    In the old application i used a FrameBufferObject(FBO) for object picking. This was done by having an extra render pass which painted each Object in the scene with a distinct color. Then I used glReadPixels on the FBO acquire the color and identifying the object. This was done in the mouseMove event of the QT Widget.

    Hoever in QML it seems that the OpenGL code completely separated from the GUI code, which is sort of nice, but now I face the problem on how to exchange information between the QQuickFramebufferObject and the QQuickFramebufferObject::Renderer. Its the renderer which owns the FBO and the mouse events belong to QQuickFramebufferObject. It seems like the two objects lives in separate threads. What is the procedure for passing mouse coordinates to the renderer and then return a pixel from the picking FBO?

    I tried a direct call, glReadPixels, however this does not work. I also tried to copy the FBO data into a shared buffer on each render pass, but that causes the application to crash.

    Any ideas?

    /Anders

    1 Reply Last reply
    0
    • veryqtpersonV Offline
      veryqtpersonV Offline
      veryqtperson
      wrote on last edited by
      #2

      I might be out of my depths, but I think that is what synchronize() is for.

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved