Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
OpenGLWidget not swapping?
Zajo last edited by 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?
Zajo last edited by
I switched to using QGLWidget and now it works. Any idea why it isn't working with QOpenGLWidget?
VitorAMJ last edited by
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)