PDA

View Full Version : OpenGL drawing outside QGLWidget



zzz9
29th January 2012, 10:01
Hi. I want to extend the functionality of my QGLWidget drawing functions by plugins. Mainly, I want to execute opengl drawing commands placed in plugin to draw on QGLWidget that is inside main application. Plugin is not connected and shouldn't contain QGLWidget class as self-depended class (there is only one QGLWidget in the application), the only instance of the widget is in the main application.
How can I achive this effect?
I looked into GLContext class, but I guess there must be only one context connected to QGLWidget. Another idea to use pure opengl commands in a plugin and use handle of QGLWidget's context.
But I'm afraid to choose the wrong approach, thus all ideas are appreciated.

wysota
29th January 2012, 15:34
Pass a pointer to the widget or to the context to your plugin.