I'm having some issues with calling a function through an object pointer in my game state class:
class GameState {
public:
virtual void init(Engine*) = 0;
virtual void cleanUp() = 0;
virtual void pause(Engine*) = 0;
virtual void resume(Engine*) = 0;
virtual void handleEvents(Engine*) = 0;
virtual void update(Engine*) = 0;
virtual void draw(Engine*) = 0;
void changeEvent(Engine* game, GameState* state) {
}
};
Every single line gives me errors, because of the Engine pointers I'm trying to make. (and yes I have included the Engine.h file) But, when in my Engine.h file when I use the GameState pointers, they work fine:
class Engine {
private:
sf::RenderWindow window;
sf::Event event;
std::vector<GameState*> states;
public:
void init();
void start();
void cleanUp();
void changeState(GameState*);
void pushState(GameState*);
void popState();
void handleEvents();
void update();
void draw();
};
I think it's some sort of initialization problem, once class getting defined before the first, but I don't know how to fix it. Any help is appreciated, thank you for your time.