void VehicleSim::mouse_callback(GLFWwindow* window, int button, int action, int mods) { // Get class instance VehicleSim* app = (VehicleSim*)glfwGetWindowUserPointer(window); Gwen::Controls::Canvas* canvas = app->_guiCanvas; b2World& physWorld = app->_physWorld; common::Camera& cam = app->_camera; // Update GUI canvas->InputMouseButton(button, (action == GLFW_PRESS)); // Get viewport common::Viewport viewport = cam.getViewport(); // Update tools std::vector<Tool*>& tools = app->_tools; for (auto it = tools.begin(); it != tools.end(); ++it) { (*it)->click_base(button, action, mods); } }