// // Created by sebastian on 08.02.26. // #ifndef MASTERRENDERER_H #define MASTERRENDERER_H #include #include #include "MinimapRenderer.h" #include "Renderer.h" #include "TerrainRenderer.h" #include "WorldSpriteRenderer.h" #include "../layer/entities/Entity.h" #include "model/RenderTargets.h" #include "model/TexturedModel.h" class Camera; class Light; class MasterRenderer { private: std::unordered_map>> entities; std::unordered_map>> terrainTiles; std::unordered_map> worldSprites; std::vector minimapRenderData; glm::mat4 projectionMatrix; std::unique_ptr entityRenderer; std::unique_ptr terrainRenderer; std::unique_ptr worldSpriteRenderer; std::unique_ptr minimapRenderer; constexpr static float FOV = 70.0f; constexpr static float NEAR_PLANE = 0.1f; constexpr static float FAR_PLANE = 1000.0f; static glm::mat4 createProjectionMatrix(); public: MasterRenderer() : projectionMatrix(createProjectionMatrix()), entityRenderer(std::make_unique(projectionMatrix)), terrainRenderer(std::make_unique(projectionMatrix)), worldSpriteRenderer(std::make_unique(projectionMatrix)), minimapRenderer(std::make_unique(600,400)) { glEnable(GL_CULL_FACE); glCullFace(GL_BACK); RenderTargets::instance().setMinimapTexture(minimapRenderer->getMinimapTexture()); }; void render(const Light &light, const Camera &camera); void submitEntity(std::unique_ptr entity); void submitTerrainTile(const std::shared_ptr& transform, const std::shared_ptr& model, const std::shared_ptr< TileRenderComponent>&, const std::shared_ptr& owner); void submitWorldSprite(const std::shared_ptr &transform, const std::shared_ptr &sprite, const std:: shared_ptr &texture); [[nodiscard]] glm::mat4 getProjectionMatrix() const {return projectionMatrix;} }; #endif //MASTERRENDERER_H