MetaImGUI 1.0.0
ImGui Application Template for C++20
Loading...
Searching...
No Matches
MetaImGUI::Application Class Reference

Main application class that orchestrates the application lifecycle. More...

#include <Application.h>

Public Member Functions

 Application ()
 
 ~Application ()
 
 Application (const Application &)=delete
 
Applicationoperator= (const Application &)=delete
 
 Application (Application &&)=delete
 
Applicationoperator= (Application &&)=delete
 
bool Initialize ()
 Initialize the application and all subsystems.
 
void Run ()
 Run the main application loop.
 
void Shutdown ()
 Shutdown the application and cleanup resources.
 
bool ShouldClose () const
 Check if the application should close.
 

Detailed Description

Main application class that orchestrates the application lifecycle.

The Application class follows the Single Responsibility Principle by delegating window management to WindowManager and UI rendering to UIRenderer. It focuses on high-level orchestration, state management, and business logic.

The Application class coordinates all major subsystems:

Usage Example

int main() {
if (!app.Initialize()) {
return 1;
}
app.Run(); // Blocks until application closes
app.Shutdown();
return 0;
}
Main application class that orchestrates the application lifecycle.
Definition Application.h:69
void Shutdown()
Shutdown the application and cleanup resources.
bool Initialize()
Initialize the application and all subsystems.
void Run()
Run the main application loop.
int main()
Definition main.cpp:22
See also
WindowManager, UIRenderer, ConfigManager

Definition at line 69 of file Application.h.

Constructor & Destructor Documentation

◆ Application() [1/3]

MetaImGUI::Application::Application ( )

Definition at line 42 of file Application.cpp.

◆ ~Application()

MetaImGUI::Application::~Application ( )

Definition at line 44 of file Application.cpp.

References Shutdown().

◆ Application() [2/3]

MetaImGUI::Application::Application ( const Application )
delete

◆ Application() [3/3]

MetaImGUI::Application::Application ( Application &&  )
delete

Member Function Documentation

◆ Initialize()

bool MetaImGUI::Application::Initialize ( )

Initialize the application and all subsystems.

Initializes all components in the correct order:

  1. Logger system
  2. Configuration manager (loads settings)
  3. Localization system (loads translations)
  4. Window manager (creates GLFW window)
  5. UI renderer (initializes ImGui)
  6. Dialog manager
  7. Update checker (starts async update check)
Returns
true if all subsystems initialized successfully, false otherwise
Note
Must be called before Run()
See also
Shutdown()

Definition at line 48 of file Application.cpp.

References MetaImGUI::Info, MetaImGUI::Logger::Initialize(), MetaImGUI::Localization::Instance(), MetaImGUI::Logger::Instance(), MetaImGUI::Localization::LoadTranslations(), LOG_DEBUG, LOG_ERROR, LOG_INFO, and MetaImGUI::Localization::SetLanguage().

Referenced by main().

◆ operator=() [1/2]

Application & MetaImGUI::Application::operator= ( Application &&  )
delete

◆ operator=() [2/2]

Application & MetaImGUI::Application::operator= ( const Application )
delete

◆ Run()

void MetaImGUI::Application::Run ( )

Run the main application loop.

Enters the main event loop which continues until the window is closed. The loop processes:

  • Window events (resize, input, etc.)
  • ImGui frame rendering
  • Application logic updates
Note
This method blocks until the application is closed
Must be called after successful Initialize()
See also
ShouldClose()

Definition at line 202 of file Application.cpp.

References ShouldClose().

Referenced by main().

◆ ShouldClose()

bool MetaImGUI::Application::ShouldClose ( ) const

Check if the application should close.

Returns
true if the application should close

Definition at line 251 of file Application.cpp.

Referenced by Run().

◆ Shutdown()

void MetaImGUI::Application::Shutdown ( )

Shutdown the application and cleanup resources.

Performs graceful shutdown of all subsystems in reverse order:

  • Saves configuration (window size, preferences)
  • Destroys update checker
  • Destroys dialog manager
  • Destroys UI renderer
  • Destroys window manager
  • Destroys configuration manager
  • Shuts down logger
Note
Safe to call multiple times
Automatically called by destructor if not called explicitly

Definition at line 209 of file Application.cpp.

References MetaImGUI::Localization::Instance(), MetaImGUI::Logger::Instance(), LOG_INFO, and MetaImGUI::Logger::Shutdown().

Referenced by main(), and ~Application().


The documentation for this class was generated from the following files: