MayaFlux 0.1.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 27 of file WindowManager.cpp.

28{
29 if (m_window_lookup.count(create_info.title) > 0) {
31 "Window with title '{}' already exists", create_info.title);
32 return nullptr;
33 }
34
36 "Creating window '{}' ({}x{}), for platform {}", create_info.title, create_info.width, create_info.height, GLFWSingleton::get_platform());
37
38 auto window = create_window_internal(create_info);
39 if (!window) {
40 return nullptr;
41 }
42
43 m_windows.push_back(window);
44 m_window_lookup[create_info.title] = window;
45
46 if (window->get_create_info().register_for_processing) {
47 m_processing_windows.push_back(window);
48 }
49
51 "Created window '{}' - total: {}", create_info.title, m_windows.size());
52
53 return window;
54}
#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: