14#include <unordered_map>
26struct RenderResourceContext;
59 virtual void Initialize();
64 virtual void Update(
float deltaTime);
72 virtual void Shutdown();
83 static std::vector<std::pair<std::string, Factory>>& GetPendingRegistrations();
92 void LoadScene(std::string sceneName);
110 static bool RegisterScene(
const std::string& name,
Factory factory);
117 static std::unique_ptr<Scene> CreateScene(
const std::string& name,
SceneManager& sm);
119 std::shared_ptr<TextRenderer> GetTextRenderer();
123 static std::unordered_map<std::string, Factory>& GetMap()
125 static std::unordered_map<std::string, Factory> map;
135 std::unique_ptr<Scene> mCurrentScene;
136 std::unique_ptr<Scene> mNextScene;
138 std::shared_ptr<TextureCache> mTextureCache;
139 std::shared_ptr<ModelCache> mModelCache;
140 std::shared_ptr<MaterialCache> mMaterialCache;
141 std::shared_ptr<TextRenderer> mTextRenderer;
149template <
class TScene>
158 return std::make_unique<TScene>(sm);
167#define REG_SCENE(Type, NameStr) \
168 static rendering_engine::SceneAutoRegistrar<Type> \
169 _auto_registrar_##Type##__{NameStr}
181#define RE_CAT_INNER(a,b) a##b
182#define RE_CAT(a,b) RE_CAT_INNER(a,b)
192#define START_SCENE(NameStr) \
193 static StartSceneAutoSetter RE_CAT(_start_scene_, __COUNTER__){NameStr}
Defines a generic application interface for rendering-based programs.
Defines an abstract interface for rendering backends.
Manages scenes, resource caches, and scene transitions within the rendering engine.
static std::string sStartSceneName
static std::vector< std::pair< std::string, Factory > > & GetPendingRegistrations()
Type alias for the factory used to create scenes.
std::function< std::unique_ptr< Scene >(SceneManager &)> Factory
Aggregates pointers to global rendering resource managers.
Template-based auto-registrar for scenes.
SceneAutoRegistrar(const char *name)
Helper struct for automatically setting the start scene name.
StartSceneAutoSetter(const char *n)