Covellite++  Version: 2.3.0 Revision: ??? Platform: x64 Build: 23:13 04.01.2025
Кроссплатформенный фреймворк для разработки приложений на С++
Загрузка...
Поиск...
Не найдено
Renderer.hpp
1
2#pragma once
3#include <vector>
4#include <functional>
5#include <alicorn/std/string.forward.hpp>
6#include <alicorn/std.memory/unique-ptr.hpp>
7#include <Covellite/Predefined.hpp>
8#include <Covellite/Api/Component.hpp>
9
10namespace covellite
11{
12
13namespace api { namespace renderer { class Renderer; } }
14
15namespace gui
16{
17
42class Renderer final :
43 public CovelliteGui::RenderInterface
44{
45 using String_t = ::alicorn::extension::std::String;
46 using Render_t = ::std::function<void(void)>;
47 using Renders_t = ::std::vector<Render_t>;
49 using RendersPtr_t = ::std::shared_ptr<Component_t::Renders>;
50 using ComponentPtr_t = ::std::shared_ptr<Component_t>;
51 using Object_t = ::std::vector<ComponentPtr_t>;
52
53public:
54 // Интерфейс CovelliteGui::RenderererInterface
55 void RenderGeometry(CovelliteGui::Vertex *, int, int *, int,
56 CovelliteGui::TextureHandle, const CovelliteGui::Vector2f &) override;
57 CovelliteGui::CompiledGeometryHandle CompileGeometry(CovelliteGui::Vertex *,
58 int, int *, int, CovelliteGui::TextureHandle) override;
59 void RenderCompiledGeometry(CovelliteGui::CompiledGeometryHandle,
60 const CovelliteGui::Vector2f &) override;
61 void ReleaseCompiledGeometry(CovelliteGui::CompiledGeometryHandle) override;
62 void EnableScissorRegion(bool) override;
63 void SetScissorRegion(int, int, int, int) override;
64 bool LoadTexture(CovelliteGui::TextureHandle &, CovelliteGui::Vector2i &,
65 const CovelliteGui::String &) override;
66 bool GenerateTexture(CovelliteGui::TextureHandle &,
67 const CovelliteGui::byte *, const CovelliteGui::Vector2i &) override;
68 void ReleaseTexture(CovelliteGui::TextureHandle) override;
69
70public:
71 void RenderScene(void);
72
73private:
74 const RendersPtr_t m_pRenders;
75
76private:
77 const Renders_t m_DefaultRenders;
78 ComponentPtr_t m_pScissorRect;
79
80 class Object
81 {
82 public:
83 ComponentPtr_t pPosition;
84 Renders_t Renders;
85 };
86
87 ::std::map<size_t, Object> m_Objects;
88
89 Renders_t m_RenderQueue;
90
91public:
92 explicit Renderer(const RendersPtr_t &);
93
94private:
95 friend ::covellite::api::renderer::Renderer;
96};
97
98} // namespace gui
99
100} // namespace covellite
Класс входит в проект Covellite.Api Класс компонента.
Definition Component.hpp:35
Класс входит в проект Covellite.Gui Класс обобщенной логики рендеринга GUI.
Definition Renderer.hpp:44
bool LoadTexture(CovelliteGui::TextureHandle &, CovelliteGui::Vector2i &, const CovelliteGui::String &) override
Definition Renderer.cpp:254