PDA

View Full Version : Shared rendering class



PaladinOfKaos
14th March 2007, 16:00
I'm working on an app using OpenGL and FBOs. The FBOs need to use the same basic rendering code as the main window, so I'm left with two choices:


MyRenderer: public QGLWidget, private CoreRenderer
{
}
-OR-
MyRenderer: public QGLWidget
{
private:
CoreRenderer renderer;
}

The same options also exist for the FBO class.

Will Qt care which way I do it? And if not, which way would work nicest with Qt?

wysota
14th March 2007, 16:32
Provided that CoreRenderer doesn't inherit QObject, Qt won't mind.

PaladinOfKaos
14th March 2007, 16:38
I'll go with the inheritance, then. The renderer class doesn't need to use QObject for anything, so there shouldn't be any problems.

Thanks for the fast response :)