| 1 | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************// |
| 2 | //*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********// |
| 3 | #pragma once |
| 4 | |
| 5 | #include "BsPrerequisites.h" |
| 6 | #include "RenderAPI/BsSubMesh.h" |
| 7 | |
| 8 | namespace bs { namespace ct |
| 9 | { |
| 10 | /** @addtogroup Renderer-Engine-Internal |
| 11 | * @{ |
| 12 | */ |
| 13 | |
| 14 | /** Contains all information needed for rendering a single sub-mesh. Closely tied with Renderer. */ |
| 15 | class BS_EXPORT RenderElement |
| 16 | { |
| 17 | public: |
| 18 | /** Reference to the mesh to render. */ |
| 19 | SPtr<Mesh> mesh; |
| 20 | |
| 21 | /** Portion of the mesh to render. */ |
| 22 | SubMesh subMesh; |
| 23 | |
| 24 | /** Material to render the mesh with. */ |
| 25 | SPtr<Material> material; |
| 26 | |
| 27 | /** Index of the technique in the material to render the element with. */ |
| 28 | UINT32 techniqueIdx; |
| 29 | |
| 30 | /** All GPU parameters from the material used by the renderable. */ |
| 31 | SPtr<GpuParamsSet> params; |
| 32 | |
| 33 | /** Renderer specific value that identifies the type of this renderable element. */ |
| 34 | UINT32 type = 0; |
| 35 | |
| 36 | /** Executes the draw call for the render element. */ |
| 37 | virtual void draw() const = 0; |
| 38 | |
| 39 | protected: |
| 40 | ~RenderElement() = default; |
| 41 | }; |
| 42 | |
| 43 | /** @} */ |
| 44 | }} |