// Copyright (c) 2022 Dominic Masters // // This software is released under the MIT License. // https://opensource.org/licenses/MIT #pragma once #include "util/flag.hpp" #include "RenderTarget.hpp" #define RENDER_MANAGER_RENDER_FLAG_DEPTH_TEST FLAG_DEFINE(0) #define RENDER_MANAGER_RENDER_FLAG_BLEND FLAG_DEFINE(1) typedef flag_t renderflag_t; namespace Dawn { class DawnGame; class RenderPipeline; class ShaderManager; class IRenderManager { protected: renderflag_t renderFlags = 0; public: DawnGame *game; /** * Default constructor for a render manager instance. * * @param game Game that this render manager belongs to. */ IRenderManager(DawnGame *game) { assertNotNull(game, "IRenderManager::IRenderManager: Game cannot be null"); this->game = game; } /** * Returns the primary render target (the backbuffer) that draws directly * to the screen. * * @return Shared pointer to the backbuffer render target. */ virtual 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(renderflag_t renderFlags) = 0; /** * Initialize / Start the Render Manager. * * @param game Game instance this render manager belongs to. */ virtual void init() = 0; /** * Perform a synchronous frame update on the render manager. */ virtual void update() = 0; }; }