Loading...
Searching...
No Matches
EntryPoint.h
Go to the documentation of this file.
1//
2// Created by denzel on 22/10/2025.
3//
4
5#pragma once
6
7#include "hellfire/core/Application.h"
8
9namespace hellfire {
10 /**
11 * @brief Application configuration interface
12 *
13 * Application using the Hellfire engine should implement this interface
14 * to configure their application instance.
15 */
16
18 public:
19 virtual ~IApplicationConfig() = default;
20
21 /**
22 * @brief Get the window width
23 */
24 virtual int get_window_width() = 0;
25
26 /**
27 * @brief Get the window height
28 */
29 virtual int get_window_height() = 0;
30
31 /**
32 * @brief Get the application title
33 */
34 virtual const std::string get_title() const = 0;
35
36 /**
37 * @brief Register application-specific plugins
38 * @param app The application instance to register plugins with
39 */
40 virtual void register_plugins(Application &app) = 0;
41 };
42} // namespace hellfire
43
44// Forward declaration - must be implemented by the application
46
47#ifndef HELLFIRE_ENTRYPOINT_DEFINED
48#define HELLFIRE_ENTRYPOINT_DEFINED
49
50int main() {
51 const auto config = create_application_config();
52
53 hellfire::Application app(config->get_window_width(),
54 config->get_window_height(),
55 config->get_title());
56
57
58 config->register_plugins(app);
59
61 app.run();
62
63 return 0;
64}
65
66#endif // HELLFIRE_ENTRYPOINT_DEFINED
int main()
Definition EntryPoint.h:50
std::unique_ptr< hellfire::IApplicationConfig > create_application_config()
Application configuration interface.
Definition EntryPoint.h:17
virtual int get_window_height()=0
Get the window height.
virtual ~IApplicationConfig()=default
virtual void register_plugins(Application &app)=0
Register application-specific plugins.
virtual int get_window_width()=0
Get the window width.
virtual const std::string get_title() const =0
Get the application title.