From c71fd5f2312bc70eec960c2785bf26d73334d6c3 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Thu, 17 Aug 2017 20:11:52 +0500 Subject: 2017-08-17 --- src/RendererSection.hpp | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) (limited to 'src/RendererSection.hpp') diff --git a/src/RendererSection.hpp b/src/RendererSection.hpp index 57d04d5..fe5e96b 100644 --- a/src/RendererSection.hpp +++ b/src/RendererSection.hpp @@ -13,39 +13,35 @@ #include "Vector.hpp" #include "Renderer.hpp" -class RendererSection : Renderer { - Vector sectionPosition; - World *world; - GLuint Vao, VboTextures, VboModels, VboColors; - std::vector models; - std::vector textures; - std::vector colors; +struct RendererSectionData { + std::vector models; + std::vector textures; + std::vector colors; + size_t hash; + Vector sectionPos; + + RendererSectionData(World *world, Vector sectionPosition); +}; +class RendererSection { + GLuint Vao, VboTextures, VboModels, VboColors; + static GLuint VboVertices, VboUvs; static std::map refCounterVbo; static std::map refCounterVao; - - - bool isEnabled = false; - - size_t hash = 0; + size_t hash; + Vector sectionPos; public: - RendererSection(World *world, Vector position); + RendererSection(RendererSectionData data); RendererSection(const RendererSection &other); - ~RendererSection() override; - - void Render(RenderState &renderState) override; - - void PrepareResources() override; - - void PrepareRender() override; + ~RendererSection(); - void SetEnabled(bool isEnabled); + void Render(RenderState &renderState); - Section *GetSection(); + Vector GetPosition(); - bool IsNeedResourcesPrepare() override; + size_t GetHash(); size_t numOfFaces = 0; }; \ No newline at end of file -- cgit v1.2.3