2024-03-03 23:22:23 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
struct SDL_Window; // forward-dec
|
|
|
|
|
|
|
|
namespace engine {
|
|
|
|
|
|
|
|
class Application; // forward-dec
|
|
|
|
|
2024-06-04 18:01:49 +00:00
|
|
|
// a class that extends many classes in the engine to expose 'global' functionality
|
2024-03-03 23:22:23 +00:00
|
|
|
class ApplicationComponent {
|
2024-06-04 18:01:49 +00:00
|
|
|
private:
|
|
|
|
Application& m_app;
|
2024-03-03 23:22:23 +00:00
|
|
|
|
2024-06-04 18:01:49 +00:00
|
|
|
public:
|
|
|
|
ApplicationComponent() = delete;
|
|
|
|
ApplicationComponent(const ApplicationComponent&) = delete;
|
2024-03-03 23:22:23 +00:00
|
|
|
|
2024-06-04 18:01:49 +00:00
|
|
|
~ApplicationComponent() = default;
|
2024-03-03 23:22:23 +00:00
|
|
|
|
2024-06-04 18:01:49 +00:00
|
|
|
ApplicationComponent& operator=(const ApplicationComponent&) = delete;
|
2024-03-03 23:22:23 +00:00
|
|
|
|
2024-06-04 18:01:49 +00:00
|
|
|
protected:
|
|
|
|
ApplicationComponent(Application& app) : m_app(app) {}
|
|
|
|
|
|
|
|
std::string getResourcePath(const std::string& relative_path) const;
|
|
|
|
SDL_Window* getWindowHandle() const;
|
|
|
|
const char* getAppName() const;
|
|
|
|
const char* getAppVersion() const;
|
2024-03-03 23:22:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace engine
|