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. Best method for cross-platform GPU accelerated drawing, other than Qt Quick?
Forum Updated to NodeBB v4.3 + New Features

Best method for cross-platform GPU accelerated drawing, other than Qt Quick?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 440 Views 2 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.
  • Guy GizmoG Offline
    Guy GizmoG Offline
    Guy Gizmo
    wrote on last edited by Guy Gizmo
    #1

    I have a Qt 6.2 app that's cross-platform for macOS and Windows, and I'm working on a feature that requires hardware accelerated drawing. Specifically, I need render hundreds (perhaps thousands) of dynamic, animated 2D polygons with per-vertex colors and alpha blending in a full-screen transparent window, and preferably at 60 fps or better. This of course is no problem for modern graphics hardware, but would be tough if done purely on the CPU.

    After doing some research, it seems that the recommendation as of late is to use Qt Quick for hardware accelerated drawing since it uses modern backends like DirectX and Metal, and is well optimized. However, my app is in C++ and uses widgets, not Qt Quick, so unless there's no other alternatives, I'd prefer not to utilize Qt Quick for this. The alternative seems to be the Graphics View Framework. From what I've read, that's only hardware accelerated with OpenGL.

    Ordinarily that would be just fine for my needs, but Apple has deprecated OpenGL and will probably completely remove it from macOS at some indeterminate point in the future. When that happens, I think I would find myself in some trouble if I implemented this drawing in OpenGL.

    So now I'm not sure what to do!

    Is there any plan to update Graphics View to use something other than OpenGL for hardware accelerated rendering, for when Apple finally drops OpenGL from macOS? If not, that means to me that it's likely not a good choice for me.

    If I were to use Qt Quick, is it appropriate for rendering polygons with per vertex colors and alpha? (I ask because Graphics View doesn't have that capability, and when using it I'd have to write custom OpenGL to accomplish it. I'm hoping to avoid having to write per-platform rendering implementations!)

    Is there perhaps another alternative I've missed, other than Graphics View or Qt Quick?

    1 Reply Last reply
    1
    • A Offline
      A Offline
      Asperamanca
      wrote on last edited by
      #2

      You could try QQuickWidget. It has some performance overhead compared to QQuickView, but it embeds well with widgets, and uses the same rendering pipeline as Qt Quick (although it does not use a separate rendering thread, but performance in that context is something you would need to test, anyway)

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Asperamanca
        wrote on last edited by
        #3

        You could also go more low level and render into QWidgets using QRhi, see https://doc.qt.io/qt-6/qtgui-overview.html#rhi-graphics

        Guy GizmoG 1 Reply Last reply
        0
        • A Asperamanca

          You could also go more low level and render into QWidgets using QRhi, see https://doc.qt.io/qt-6/qtgui-overview.html#rhi-graphics

          Guy GizmoG Offline
          Guy GizmoG Offline
          Guy Gizmo
          wrote on last edited by Guy Gizmo
          #4

          @Asperamanca said in Best method for cross-platform GPU accelerated drawing, other than Qt Quick?:

          You could also go more low level and render into QWidgets using QRhi, see https://doc.qt.io/qt-6/qtgui-overview.html#rhi-graphics

          Damn, this would be perfect, but my software still targets macOS 10.14 so Qt 6.6 is not an option for me. (I just realized I forgot to mention I'm on Qt 6.2 in my original post, so I'll edit that.)

          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