Dawn/src/dawn/display/RenderPipeline.hpp

64 lines
2.0 KiB
C++

// Copyright (c) 2022 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "display/IRenderManager.hpp"
#include "display/shader/ShaderPass.hpp"
#include "scene/components/display/IRenderable.hpp"
#include "display/shader/buffers/RenderPipelineShaderBuffer.hpp"
#include "scene/components/display/Camera.hpp"
namespace Dawn {
class RenderManager;
class RenderPipeline : public std::enable_shared_from_this<RenderPipeline> {
private:
int_fast16_t renderId = -1;
public:
std::weak_ptr<RenderManager> renderManager;
RenderPipelineShaderBuffer shaderBuffer;
/**
* Constructs a new RenderPipeline. Render Pipelines are my attempt to
* create both a flexible, but standard way to allow the individual games
* to decide how they want to render the common scene-item models.
*/
RenderPipeline();
/**
* Initialize the render pipeline.
*
* @param renderManager Parent render manager this pipeline belongs to.
*/
virtual void init(const std::weak_ptr<RenderManager> renderManager);
/**
* Renders the games' currently active scene, and all of its' cameras.
*/
virtual void render();
/**
* Render a specific scene, usually just called for the currently active
* scene, but in future this could include sub-scenes.
*
* @param scene Scene to render.
*/
virtual void renderScene(std::shared_ptr<Scene> scene);
/**
* Render a specific camera on a specific scene.
*
* @param scene Scene to render.
* @param camera Camera within the scene to render.
*/
virtual void renderSceneCamera(std::shared_ptr<Scene> scene, std::shared_ptr<Camera> camera);
/**
* Cleanup a render pipeline that has been initialized.
*/
virtual ~RenderPipeline();
};
}