HI,
I have a question.
I'd like to show in my application 3 GLView that show different object...Do I code 3 different GL class or what?
Thanks
HI,
I have a question.
I'd like to show in my application 3 GLView that show different object...Do I code 3 different GL class or what?
Thanks
Regards
Do you mean 3 different class instances?
instances? it mean 3 different class declarations in 3 different header files that everyone will have an instance. If 3 widget must show 3 different objects I must to do this?
Regards
No, why? If you tell your class how to draw three different scenes, you can use it multiple times.
I thinks you says something so:
I have the way to retrieve myWidget1 pointer..but have you other idea?Qt Code:
myWidget:: paintGL(){ ..... if (this== mywidget1) drawCube() if (this== mywidget2) drawCube() }To copy to clipboard, switch view to plain text mode
thanks.
Regards
More likely something like:
Qt Code:
public: void paintGL(){ switch(_which){ case 0: drawCube(); break; case 1: drawCone(); break; case 2: drawSphere(); break; default: drawTeaPot(); } } // ... private: int _which; };To copy to clipboard, switch view to plain text mode
sorry, where is the increment of wich parameter?
Regards
I didn't mean to complicate things by asking multiple class instances question.
Typically, I have a single scene graph instance ... passing the top-level scene graph node to each window. Each window is able to render different portions of the scene graph by using different cull masks. In this case I have multiple instances of a single class (something that renders a scene via OpenGL widget and a cull mask). Hope this makes more sense.
It seems to me this is the concept that wysota is trying to demonstrate. You can filter what you want to display based upon some filtering mechanism.
Cheers,
Ben
What increment? You pass the value of "which" in the class constructor and based upon that the widget renders different scenes.Originally Posted by mickey
Bookmarks