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

◆ create_window()

std::shared_ptr< Window > MayaFlux::Core::WindowManager::create_window ( const WindowCreateInfo create_info)

Creates a new window.

Parameters
create_infoWindow creation parameters
Returns
Pointer to created window (owned by manager)

Definition at line 29 of file WindowManager.cpp.

30{
31 if (m_window_lookup.count(create_info.title) > 0) {
33 "Window with title '{}' already exists", create_info.title);
34 return nullptr;
35 }
36
38 "Creating window '{}' ({}x{}), for platform {}", create_info.title, create_info.width, create_info.height, GLFWSingleton::get_platform());
39
40 auto window = create_window_internal(create_info);
41 if (!window) {
42 return nullptr;
43 }
44
45 m_windows.push_back(window);
46 m_window_lookup[create_info.title] = window;
47
48 if (window->get_create_info().register_for_processing) {
49 m_processing_windows.push_back(window);
50 }
51
53 "Created window '{}' - total: {}", create_info.title, m_windows.size());
54
55 return window;
56}
#define MF_INFO(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
static std::string get_platform()
Gets the current GLFW platform (Wayland, X11, etc.)
std::vector< std::shared_ptr< Window > > m_windows
std::shared_ptr< Window > create_window_internal(const WindowCreateInfo &create_info)
Factory for creating backend-specific windows.
std::unordered_map< std::string, std::weak_ptr< Window > > m_window_lookup
std::vector< std::shared_ptr< Window > > m_processing_windows
@ WindowingSubsystem
Windowing system operations (GLFW, SDL)
@ Core
Core engine, backend, subsystems.

References MayaFlux::Journal::Core, create_window_internal(), MayaFlux::Core::GLFWSingleton::get_platform(), MayaFlux::Core::WindowCreateInfo::height, m_processing_windows, m_window_lookup, m_windows, MF_INFO, MF_WARN, MayaFlux::Core::WindowCreateInfo::title, MayaFlux::Core::WindowCreateInfo::width, and MayaFlux::Journal::WindowingSubsystem.

Referenced by MayaFlux::create_window().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: