47 lines
1.6 KiB
C++
47 lines
1.6 KiB
C++
// Copyright (c) 2022 Dominic Masters
|
|
//
|
|
// This software is released under the MIT License.
|
|
// https://opensource.org/licenses/MIT
|
|
|
|
#pragma once
|
|
#include "assert/assertgl.hpp"
|
|
#include "display/BackBufferRenderTarget.hpp"
|
|
#include "display/shader/ShaderManager.hpp"
|
|
#include "display/shader/shaders/SimpleTexturedShader.hpp"
|
|
#include "display/shader/shaders/FontShader.hpp"
|
|
#include "display/shader/shaders/UIShader.hpp"
|
|
#include "display/RenderPipeline.hpp"
|
|
|
|
namespace Dawn {
|
|
class RenderManager : public IRenderManager {
|
|
private:
|
|
std::shared_ptr<RenderPipeline> renderPipeline;
|
|
std::shared_ptr<ShaderManager> shaderManager;
|
|
shaderlock_t lockSimpleTextured = -1;
|
|
shaderlock_t lockUIShaderProgram = -1;
|
|
shaderlock_t lockFontShader = -1;
|
|
|
|
public:
|
|
std::shared_ptr<BackBufferRenderTarget> backBuffer;
|
|
SimpleTexturedShader *simpleTexturedShader = nullptr;
|
|
UIShader *uiShader = nullptr;
|
|
FontShader *fontShader = nullptr;
|
|
|
|
/**
|
|
* Construct a new RenderManager for a game instance.
|
|
*/
|
|
RenderManager();
|
|
|
|
std::shared_ptr<RenderTarget> getBackBuffer() override;
|
|
std::shared_ptr<RenderPipeline> getRenderPipeline() override;
|
|
std::shared_ptr<ShaderManager> getShaderManager() override;
|
|
void setRenderFlags(flag_t renderFlags) override;
|
|
void init(std::weak_ptr<DawnGame> game) override;
|
|
void update() override;
|
|
|
|
/**
|
|
* Destroy a previously initialized RenderManager.
|
|
*/
|
|
~RenderManager();
|
|
};
|
|
} |