hello guys I have a problem with an Event Manager
first I have A Lambda that responsible for sending the event to my event Manager
glfwSetWindowSizeCallback(m_Window, [](GLFWwindow* window , int Width , int Height) {
WindowData Data = *(WindowData*)glfwGetWindowUserPointer(window);
WindowResize ReSize(Data.ID, Width, Height);
EventsManager::Get().PushEvent(&ReSize);
});
PushEvent Function should push back the pointer to the event queue which is on std:: vector<IEvent*>
void EventsManager::PushEvent(IEvent* e)
{
m_EventsQueue.push_back(e);
}
actually this method is working fine when I have a single event but when I have multiple events in a row I got an access violation.
I just want to understand why this is happening and how I can work around this?