I’m trying to get OF inside a Qt window. So far i got a lot of success i can display of graphics in a QWidget and create Qt UIs to change parameters in of app.
So I created an ofAppQtWindow that pretty much mimics the ofAppGLFWWindow but substitutes GLFW calls for Qt calls.
Problem is when i try to setup the ofGLRenderer with :
it probably has to do with how you are initializing the frame buffer for the window, you might need to add alpha and multisampling bits to the buffer while setting it up. probably even depth too if that doesn’t happen by default
Thanks @arturo I didn’t read carefully… sorry for that.
@chuckleplant Yes i would love to share it! I will do a pull request soon. Its still in a very early stage, and there are so many things I don’t know how to handle yet, for example, when i resize the window, the openGL viewport has to be re-adjusted and i haven’t found the right place to do it. Also, Qt widgets need to be written in a separate class because of moc’ing… so the structure is a bit different from ofAppGLFWWindow, then the instructions in main.cpp also look different. Let me give it another shake and I will let you know.
I guess there are no license issues on sharing code that calls to Qt. Also It would be great if others could help me to polish this class
BTW I have a question regarding ofEvents:
I saw that both GLUT and GLFW windows use this syntax to sent events to the current application:
The second would simplify things since it does not require a pointer to the current window. My guess is that the second sends the event to all ofApps, meaning that an event to one window would be sent to all windows open… but I’m not so sure about it…
I managed to fix the resize issue and laso i kept using ofEvents in the same way as in GLFW.
So far i use QOpenGlWidget. I also got it working with QMainWindow and QWidget but interface changes a bit.
Also I have to research a good way to insert Qt widgets inside the main window.