engine/include/application_component.h

33 lines
781 B
C
Raw Permalink Normal View History

#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
class ApplicationComponent {
2024-06-04 18:01:49 +00:00
private:
Application& m_app;
2024-06-04 18:01:49 +00:00
public:
ApplicationComponent() = delete;
ApplicationComponent(const ApplicationComponent&) = delete;
2024-06-04 18:01:49 +00:00
~ApplicationComponent() = default;
2024-06-04 18:01:49 +00:00
ApplicationComponent& operator=(const ApplicationComponent&) = delete;
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;
};
} // namespace engine