1

So I have a vector of "Widgets"

std::vector<Widget> widgets;

And a class called dial which extends Widget

class Dial : public Widget

And also a loop which loops through all the Widgets in widgets. However, there is and update method in Widget which gets overriden in Dial, and whenever I loop through widgets it calls Widget's update and not Dial's update. How can I fix this? (It also calls Widget's draw and not Dial's as well)

Asad-ullah Khan
  • 1,573
  • 18
  • 22

0 Answers0