Loading...
Searching...
No Matches
Application.h
Go to the documentation of this file.
1//
2// Application.h
3//
4
5#ifndef APPLICATION_H
6#define APPLICATION_H
7
8#pragma once
9
14#include <string>
15#include <type_traits>
16
18
19namespace ml
20{
21 // ── ApplicationBase — internal base shared by Application and ApplicationWith ──
22
32 {
33 public:
38 const std::string& title,
39 UIController& appLogic,
41
45 ApplicationBase(unsigned int screenWidth,
46 unsigned int screenHeight,
47 unsigned int bitDepth,
48 const std::string& title);
49
54 const std::string& title);
55
59 void addComponent(Core& component);
60
64 static void clearEvents();
65
79 static void reset();
80 };
81
82 // ── Application — no manifest ─────────────────────────────────────────────
83
116 {
117 public:
119
120 void initialization() override = 0;
121 void registerEvents() override = 0;
122 };
123
124 // ── ApplicationWith — with manifest ───────────────────────────────────────
125
179 template<typename Manifest>
181 public ml::ManifestResources<Manifest>
182 {
183 public:
186
188
189 void initialization() override = 0;
190 void registerEvents() override = 0;
191 };
192
193} // namespace ml
194
195#endif // APPLICATION_H
AppManager(const sf::VideoMode &videoMode, const std::string &title, UIController &appLogic, sf::RenderWindow &window=WindowManager::getWindow(), Architecture architecture=MVC)
Construct an AppManager with an explicit controller and window.
static void reset()
Full application reset — clears events, messages, and components.
void addComponent(Core &component)
Register a Core object with the application's component manager.
ApplicationBase(unsigned int screenWidth, unsigned int screenHeight, unsigned int bitDepth, const std::string &title)
Construct from pixel dimensions and bit depth.
static void clearEvents()
Clear all event subscriptions across the entire application.
ApplicationBase(const sf::VideoMode &videoMode, const std::string &title)
Construct from an SFML video mode, using *this as the controller.
ApplicationBase(const sf::VideoMode &videoMode, const std::string &title, UIController &appLogic, sf::RenderWindow &window=WindowManager::getWindow())
Construct with a separate UIController and explicit video mode.
Primary entry point for Malena applications without a manifest.
void registerEvents() override=0
Attach event callbacks to components and framework objects.
void initialization() override=0
Create and register all components and resources.
ApplicationBase(const sf::VideoMode &videoMode, const std::string &title, UIController &appLogic, sf::RenderWindow &window=WindowManager::getWindow())
Construct with a separate UIController and explicit video mode.
Entry point for Malena applications with a manifest.
ml::ManifestResources< Manifest > Resources
Unified resource accessor — Resources::get(Images::Icon).
void registerEvents() override=0
Attach event callbacks to components and framework objects.
void initialization() override=0
Create and register all components and resources.
ApplicationBase(const sf::VideoMode &videoMode, const std::string &title, UIController &appLogic, sf::RenderWindow &window=WindowManager::getWindow())
Construct with a separate UIController and explicit video mode.
Virtual base class for all Malena framework objects.
Definition Core.h:67
Concrete Controller base with a per-frame update hook.
sf::RenderWindow & getWindow()
Return the framework's shared sf::RenderWindow.
Definition Component.h:18
Unified manifest resource and config accessor.