MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ glfw_mouse_button_callback()

void MayaFlux::Core::GlfwWindow::glfw_mouse_button_callback ( GLFWwindow *  window,
int  button,
int  action,
int  mods 
)
staticprivate

Definition at line 375 of file GlfwWindow.cpp.

376{
377 auto* win = static_cast<GlfwWindow*>(glfwGetWindowUserPointer(window));
378 if (!win)
379 return;
380
381 WindowEvent event;
382 event.type = (action == GLFW_PRESS) ? WindowEventType::MOUSE_BUTTON_PRESSED
384 event.timestamp = glfwGetTime();
385
386 event.data = WindowEvent::MouseButtonData {
387 .button = button,
388 .mods = mods
389 };
390
391 win->m_event_source.signal(event);
392
393 if (win->m_event_callback) {
394 win->m_event_callback(event);
395 }
396}
GlfwWindow(const WindowCreateInfo &create_info, const GraphicsSurfaceInfo &surface_info, GlobalGraphicsConfig::GraphicsApi api, GlfwPreInitConfig pre_init_config={})
Creates a window with the given configuration.
WindowEventType
Types of window and input events.

References MayaFlux::Core::WindowEvent::MouseButtonData::button, MayaFlux::Core::MOUSE_BUTTON_PRESSED, MayaFlux::Core::MOUSE_BUTTON_RELEASED, and MayaFlux::Core::WindowEvent::type.

Referenced by setup_callbacks().

+ Here is the caller graph for this function: