75 lines
2.0 KiB
C++
75 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 "util/flag.hpp"
|
|
|
|
#define RENDER_MANAGER_RENDER_FLAG_DEPTH_TEST FLAG_DEFINE(0)
|
|
#define RENDER_MANAGER_RENDER_FLAG_BLEND FLAG_DEFINE(1)
|
|
|
|
namespace Dawn {
|
|
class DawnGame;
|
|
class RenderPipeline;
|
|
class ShaderManager;
|
|
class RenderTarget;
|
|
|
|
class IRenderManager {
|
|
protected:
|
|
flag_t renderFlags = 0;
|
|
|
|
public:
|
|
std::weak_ptr<DawnGame> game;
|
|
|
|
/**
|
|
* Default constructor for a render manager instance.
|
|
*
|
|
* @param game Game that this render manager belongs to.
|
|
*/
|
|
IRenderManager() {
|
|
}
|
|
|
|
/**
|
|
* Returns the primary render target (the backbuffer) that draws directly
|
|
* to the screen.
|
|
*
|
|
* @return Shared pointer to the backbuffer render target.
|
|
*/
|
|
virtual std::shared_ptr<RenderTarget> getBackBuffer() = 0;
|
|
|
|
/**
|
|
* Returns the current render pipeline intended to be used for rendering
|
|
* the currently active scene on the game instance.
|
|
*
|
|
* @return Reference to the currently active main scene render pipeline.
|
|
*/
|
|
virtual RenderPipeline * getRenderPipeline() = 0;
|
|
|
|
/**
|
|
* Returns the shader manager that this render manager uses.
|
|
*
|
|
* @return Reference to the shader manager.
|
|
*/
|
|
virtual ShaderManager * getShaderManager() = 0;
|
|
|
|
/**
|
|
* Sets the render flags for the render manager to use.
|
|
*
|
|
* @param renderFlags Render flags to use.
|
|
*/
|
|
virtual void setRenderFlags(flag_t renderFlags) = 0;
|
|
|
|
/**
|
|
* Initialize / Start the Render Manager.
|
|
*
|
|
* @param game Game instance this render manager belongs to.
|
|
*/
|
|
virtual void init(std::weak_ptr<DawnGame> game) = 0;
|
|
|
|
/**
|
|
* Perform a synchronous frame update on the render manager.
|
|
*/
|
|
virtual void update() = 0;
|
|
};
|
|
} |