Radium Engine  1.5.20
Loading...
Searching...
No Matches
RenderObjectManager.hpp
1#pragma once
2
3#include <Engine/RaEngine.hpp>
4
5#include <array>
6#include <memory>
7#include <mutex>
8#include <set>
9#include <vector>
10
11#include <Core/Utils/Index.hpp>
12#include <Core/Utils/IndexMap.hpp>
13
14#include <Core/Types.hpp>
15#include <Engine/Rendering/RenderObjectTypes.hpp>
16
17namespace Ra {
18namespace Engine {
19namespace Rendering {
20
21class RenderObject;
22
23class RA_ENGINE_API RenderObjectManager final
24{
25 public:
26 RenderObjectManager();
27 ~RenderObjectManager();
28
29 Core::Utils::Index addRenderObject( Rendering::RenderObject* renderObject );
30 void removeRenderObject( const Core::Utils::Index& index );
31
32 size_t getRenderObjectsCount();
33
36 std::shared_ptr<Rendering::RenderObject> getRenderObject( const Core::Utils::Index& index );
37
41 const Core::Utils::IndexMap<std::shared_ptr<Rendering::RenderObject>>& getRenderObjects() const;
42
48 void getRenderObjectsByType( std::vector<std::shared_ptr<Rendering::RenderObject>>& objectsOut,
49 const Rendering::RenderObjectType& type ) const;
50
56 bool exists( const Core::Utils::Index& index ) const;
57
62 void renderObjectExpired( const Ra::Core::Utils::Index& idx );
63
68 size_t getNumFaces() const;
69
74 size_t getNumVertices() const;
75
76 private:
77 Core::Utils::IndexMap<std::shared_ptr<Rendering::RenderObject>> m_renderObjects;
78
79 std::array<std::set<Core::Utils::Index>, (int)Rendering::RenderObjectType::Count>
80 m_renderObjectByType;
81
82 mutable std::mutex m_doubleBufferMutex;
83};
84
85} // namespace Rendering
86} // namespace Engine
87} // namespace Ra
hepler function to manage enum as underlying types in VariableSet
Definition Cage.cpp:3