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 OpenGL context with glfw or SDL
QtWS25 Last Chance

Sharing OpenGL context with glfw or SDL

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 868 Views
  • 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.
  • A Offline
    A Offline
    aart
    wrote on 9 Dec 2019, 21:17 last edited by
    #1

    I am building an application which can be used to create interactive graphics in OpenGL. For live shows it is crucial that the output is always being updated, even if the UI hangs in some slow operations. This means I need to show the output on a non Qt window (SDL or glfw or something else), because Qt only supports one GUI thread. Is it possible to share OpenGL contexts between Qt and any other OpenGL windowing/ context creation library, running in a separate thread? Does anybody know what my possibilities are here?

    Thanks for your help!

    J 1 Reply Last reply 10 Dec 2019, 07:09
    0
    • A aart
      9 Dec 2019, 21:17

      I am building an application which can be used to create interactive graphics in OpenGL. For live shows it is crucial that the output is always being updated, even if the UI hangs in some slow operations. This means I need to show the output on a non Qt window (SDL or glfw or something else), because Qt only supports one GUI thread. Is it possible to share OpenGL contexts between Qt and any other OpenGL windowing/ context creation library, running in a separate thread? Does anybody know what my possibilities are here?

      Thanks for your help!

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 10 Dec 2019, 07:09 last edited by
      #2

      @aart Why not move the slow operations out of the GUI thread to another thread?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      A 1 Reply Last reply 10 Dec 2019, 20:17
      1
      • J jsulm
        10 Dec 2019, 07:09

        @aart Why not move the slow operations out of the GUI thread to another thread?

        A Offline
        A Offline
        aart
        wrote on 10 Dec 2019, 20:17 last edited by
        #3

        @jsulm The graphics should be rendered uninteruptably at 60 fps in a separate thread so that the GUI stuff cannot interfere with that. The displaying of this should also happen uninterupted which means it cannot happen on Qt's GUI thread because there could be hiccups here. Since Qt doesnt support two GUI threads I need to get creative. Thats why i wanted to use another windowing library that can run seperately from the Qt event loop and then share OpenGL contexts. Not sure if any of this is possible though :(

        1 Reply Last reply
        0
        • F Offline
          F Offline
          fcarney
          wrote on 10 Dec 2019, 20:25 last edited by
          #4

          What "GUI stuff" is going to interfere? Either the app is designed to operate at 60 fps or it is not. What else is the gui going to have besides the output window? If stuff is event driven with heavy processing of data sent to threads then nothing will cause it hang in slow ops. Are you generating content in the background?

          C++ is a perfectly valid school of magic.

          1 Reply Last reply
          1

          2/4

          10 Dec 2019, 07:09

          • Login

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