MayaFlux 0.2.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 385 of file GlfwWindow.cpp.

386{
387 auto* win = static_cast<GlfwWindow*>(glfwGetWindowUserPointer(window));
388 if (!win)
389 return;
390
391 WindowEvent event;
392 event.type = (action == GLFW_PRESS) ? WindowEventType::MOUSE_BUTTON_PRESSED
394 event.timestamp = glfwGetTime();
395
396 event.data = WindowEvent::MouseButtonData {
397 .button = button,
398 .mods = mods
399 };
400
401 win->m_event_source.signal(event);
402
403 if (win->m_event_callback) {
404 win->m_event_callback(event);
405 }
406}
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: