Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. OpenGLWidget not swapping?
Forum Updated to NodeBB v4.3 + New Features

OpenGLWidget not swapping?

Scheduled Pinned Locked Moved Unsolved Game Development
3 Posts 2 Posters 1.2k 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.
  • Z Offline
    Z Offline
    Zajo
    wrote on last edited by Zajo
    #1

    I have an OpenGLWidget which (in paintGL) I'm clearing to red (as a test). It's set as the central widget in a QMainWindow. If I grabFramebuffer and dump than into a file I get a red image, as expected, however the OpenGLWidget appears black in the main window. This seems like a swapping issue but I read that with OpenGLWidget there is no need for a manual swap.

    (This of course is not a simple program. And it is on Mac, the code works fine on Windows. Qt version 5.8)

    Any ideas what can I do to troubleshoot this issue?

    Z 1 Reply Last reply
    0
    • Z Zajo

      I have an OpenGLWidget which (in paintGL) I'm clearing to red (as a test). It's set as the central widget in a QMainWindow. If I grabFramebuffer and dump than into a file I get a red image, as expected, however the OpenGLWidget appears black in the main window. This seems like a swapping issue but I read that with OpenGLWidget there is no need for a manual swap.

      (This of course is not a simple program. And it is on Mac, the code works fine on Windows. Qt version 5.8)

      Any ideas what can I do to troubleshoot this issue?

      Z Offline
      Z Offline
      Zajo
      wrote on last edited by
      #2

      I switched to using QGLWidget and now it works. Any idea why it isn't working with QOpenGLWidget?

      1 Reply Last reply
      0
      • V Offline
        V Offline
        VitorAMJ
        wrote on last edited by
        #3

        Maybe there is a problem of context when you generate or modify the fbo while using Mac, where the Qt implementation may change context in one OS and not in the other. Another possibility is that the format may not be supported in Mac. There are OpenGL methods (and those from Qt) to enable you to perform context management, maybe just enforcing that you are handling a specific context in your functions will do the job (the makeCurrent stuff)

        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