December 2015
Beginner to intermediate
522 pages
11h 21m
English
Because the event manager needs to check all the events that get processed, it makes sense to keep it in our Window class, where we actually do the event polling. After all, the events that we're processing all originate from the window that's open, so it only makes sense to keep an instance of the event manager here. Let's make a slight adjustment to the Window class by adding a data member to it:
class Window{
public:
...
bool IsFocused();
EventManager* GetEventManager();
void ToggleFullscreen(EventDetails* l_details);
void Close(EventDetails* l_details = nullptr);
...
private:
...
EventManager m_eventManager;
bool m_isFocused;
};In addition to adding an extra method for obtaining the event manager, the full ...
Read now
Unlock full access