// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com) // This file is part of the "Nazara Engine - Graphics module" // For conditions of distribution and use, see copyright notice in Export.hpp #pragma once #ifndef NAZARA_GRAPHICS_ELEMENTRENDERER_HPP #define NAZARA_GRAPHICS_ELEMENTRENDERER_HPP #include #include #include #include #include #include #include #include #include #include #include namespace Nz { class CommandBufferBuilder; class RenderElement; class RenderResources; class Texture; class ViewerInstance; struct ElementRendererData; class NAZARA_GRAPHICS_API ElementRenderer { public: struct RenderStates; ElementRenderer() = default; virtual ~ElementRenderer(); virtual RenderElementPoolBase& GetPool() = 0; virtual std::unique_ptr InstanciateData() = 0; virtual void Prepare(const ViewerInstance& viewerInstance, ElementRendererData& rendererData, RenderResources& currentFrame, std::size_t elementCount, const Pointer* elements, SparsePtr renderStates); virtual void PrepareEnd(RenderResources& currentFrame, ElementRendererData& rendererData); virtual void Render(const ViewerInstance& viewerInstance, ElementRendererData& rendererData, CommandBufferBuilder& commandBuffer, std::size_t elementCount, const Pointer* elements) = 0; virtual void Reset(ElementRendererData& rendererData, RenderResources& renderResources); struct RenderStates { RenderStates() { shadowMapsDirectional.fill(nullptr); shadowMapsPoint.fill(nullptr); shadowMapsSpot.fill(nullptr); } std::array shadowMapsDirectional; std::array shadowMapsPoint; std::array shadowMapsSpot; RenderBufferView lightData; }; }; struct NAZARA_GRAPHICS_API ElementRendererData { ElementRendererData() = default; virtual ~ElementRendererData(); }; } #include #endif // NAZARA_GRAPHICS_ELEMENTRENDERER_HPP