MayaFlux 0.1.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 275 of file GlfwWindow.cpp.

276{
277 auto* win = static_cast<GlfwWindow*>(glfwGetWindowUserPointer(window));
278 if (!win)
279 return;
280
281 win->m_state.is_focused = (focused == GLFW_TRUE);
282
283 WindowEvent event;
284 event.type = focused ? WindowEventType::WINDOW_FOCUS_GAINED
286 event.timestamp = glfwGetTime();
287
288 win->m_event_source.signal(event);
289
290 if (win->m_event_callback) {
291 win->m_event_callback(event);
292 }
293}
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: