M
Manuel
Hi.
Before all, please excuse me for bad english and for very newbie
questions. I hope to don't boring you.
I'm trying to write a very simple GUI using openGL.
So I'm writing some different widgets classes, like buttons, images,
slider, etc...
Each class has a draw() method.
The idea is to put all widget to draw in a vector, and after, in pseudocode:
-----------------------------
for each widget w in vector:
w.draw()
-----------------------------
So I should declare the vector, like
vector<widget> widgetList;
and this is my trouble: I've different classes (that has some common
methods, like draw(), on(), off() etc...) and I should put all in one
std container. It's possible?
Really I don't know even how to declare the vector. In example, if I've
the class
----------------------------
class foo {
private:
int width;
int height;
public:
int getWidth();
int getHeight();
};
----------------------------
how to declare a container for foo? Surely not writing
vector<foo> fooList;
Should I use typedef? Can you explain me this?
I know I'm a newbie and maybe these are very silly questions. However I
can't find these info on the books I'm reading (they are for beginners,
and don't write about STD) and the same using google.
Can you help me?
Thanks,
Manuel
Before all, please excuse me for bad english and for very newbie
questions. I hope to don't boring you.
I'm trying to write a very simple GUI using openGL.
So I'm writing some different widgets classes, like buttons, images,
slider, etc...
Each class has a draw() method.
The idea is to put all widget to draw in a vector, and after, in pseudocode:
-----------------------------
for each widget w in vector:
w.draw()
-----------------------------
So I should declare the vector, like
vector<widget> widgetList;
and this is my trouble: I've different classes (that has some common
methods, like draw(), on(), off() etc...) and I should put all in one
std container. It's possible?
Really I don't know even how to declare the vector. In example, if I've
the class
----------------------------
class foo {
private:
int width;
int height;
public:
int getWidth();
int getHeight();
};
----------------------------
how to declare a container for foo? Surely not writing
vector<foo> fooList;
Should I use typedef? Can you explain me this?
I know I'm a newbie and maybe these are very silly questions. However I
can't find these info on the books I'm reading (they are for beginners,
and don't write about STD) and the same using google.
Can you help me?
Thanks,
Manuel