Hello!
I have a problem concerning the design of a opengl/qt programm.
I create a subclass from QGLWidget and overwrite the paintGl-method to do my renderstuff.
My subclass should have a vector with drawables. Drawables is a abstract class with a renderfunction. In this function every subclass from drawable should do their opengl stuff.
Something like this:
Qt Code:
class Drawable { virtual void render()=0; } class MyFirstObject : public Drawable { void render() { glBegin(GL_QUAD) ... glEnd() } } void paintGl() { for(int i=0; i< drawables.size();i++) { drawables.render(); } }To copy to clipboard, switch view to plain text mode
The problem is, that i don't have an active opengl context in my drawables and so the opengl functions don't work. How can i solve this problem?
Bookmarks