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. Sharing between QGLContext and QOpenGLContext
Forum Updated to NodeBB v4.3 + New Features

Sharing between QGLContext and QOpenGLContext

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.5k 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.
  • W Offline
    W Offline
    wrosecrans
    wrote on last edited by
    #1

    So, I have an instance of a subclass of QGLWidget, "viewport." I also have a "compositor" with a QOffscreenSurface, a QOpenGLContext and a QOpenGLFrameBufferObject. I want to draw in my viewport using the FBO as a texture. The compositor needs to be able to create its own OpenGL context so that it works regardless of whether the viewer exists or is active. (The app has a "render only" mode where no visible GUI stuff is displayed -- it just writes a file. The viewport is only for interactive mode.)

    QGLWidget::context() gets me a QGLContext, which I want to share with the QOpenGLContext. Is this the correct way to do it?

    viewport->context()->contextHandle()->setShareContext(compositor->context);

    Are there any gotchas related to sharing state between the two sorts of contexts that I should know about? Can I expect this to be portable between platforms?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Involuntary "Duplicate":http://qt-project.org/forums/viewthread/33472/

      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

      • Login

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