MayaFlux 0.3.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 390 of file GlfwWindow.cpp.

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