I was following the code in SFML Game Development by example, written by Order Nexus. I got hit by an errors in Shared Context. The code is as follows...
#include "Window.h"
#include "EventManager.h"
struct Shared_Context{
Shared_Context():m_wind(nullptr),m_eventManager(nullptr) {}
Window* m_wind;
EventManager* m_eventManager;
};
The error appears is
include\SharedContext.h|8|error: 'Window' does not name a type|
My code for Window.h is as follows...
#ifndef WINDOW_H
#define WINDOW_H
#include <SFML/Window.hpp>
#include "EventManager.h"
#include "StateManager.h"
class Window
{
public:
Window();
Window(const std::string& l_title,const sf::Vector2u& l_size);
~Window();
void BeginDraw(); // Clear the window.
void EndDraw(); // Display the changes.
void Update();
bool IsDone();
bool IsFullscreen();
sf::Vector2u GetWindowSize();
//void ToggleFullscreen();
void Draw(sf::Drawable& l_drawable);
bool IsFocused();
EventManager* GetEventManager();
void Close(/*EventDetails* l_details = nullptr*/);
protected:
private:
void Setup(const std::string l_title, const sf::Vector2u& l_size);
void Destroy();
void Create();
sf::RenderWindow m_window;
sf::Vector2u m_windowSize;
std::string m_windowTitle;
bool m_isDone;
bool m_isFullscreen;
EventManager m_eventManager;
};
#endif // WINDOW_H
I hope someone can help me and explains why do I get this error