Hi all,
I'm trying to create my own derived shape class in order to make it easier to create hexagons. However, I'm having some trouble with the abstract class sf::Shape. Right now I have:
class Hexagon : public sf::Shape {
public:
Hexagon(){}
virtual ~Hexagon();
virtual int getPointCount() {
return 6;}
virtual sf::Vector2f getPoint(unsigned int *index){
//logic I haven't figured out yet, but I don't think it should matter...
}
};
Hexagon *newhex;
newhex = new Hexagon();
Problem is, the last line is giving me two errors:
newhex error: This declaration has no storage class or type identifier
Hexagon() error: object of abstract class type "Hexagon" is not allowed.
The Hexagon() error is really confusing since I am using the abstract base sf::Shape and so Hexagon() should no longer be an abstract class. This is my first attempt at abstract base classes so I apologize if I'm doing something wrong that is very obvious.
Thanks for any help!