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

◆ glfw_window_focus_callback()

void MayaFlux::Core::GlfwWindow::glfw_window_focus_callback ( GLFWwindow *  window,
int  focused 
)
staticprivate

Definition at line 285 of file GlfwWindow.cpp.

286{
287 auto* win = static_cast<GlfwWindow*>(glfwGetWindowUserPointer(window));
288 if (!win)
289 return;
290
291 win->m_state.is_focused = (focused == GLFW_TRUE);
292
293 WindowEvent event;
294 event.type = focused ? WindowEventType::WINDOW_FOCUS_GAINED
296 event.timestamp = glfwGetTime();
297
298 win->m_event_source.signal(event);
299
300 if (win->m_event_callback) {
301 win->m_event_callback(event);
302 }
303}
GlfwWindow(const WindowCreateInfo &create_info, const GraphicsSurfaceInfo &surface_info, GlobalGraphicsConfig::GraphicsApi api, GlfwPreInitConfig pre_init_config={})
Creates a window with the given configuration.

References MayaFlux::Core::WindowState::is_focused, m_state, MayaFlux::Core::WindowEvent::type, MayaFlux::Core::WINDOW_FOCUS_GAINED, and MayaFlux::Core::WINDOW_FOCUS_LOST.

Referenced by setup_callbacks().

+ Here is the caller graph for this function: