diff options
Diffstat (limited to '')
-rw-r--r-- | src/RendererSection.hpp | 42 |
1 files changed, 19 insertions, 23 deletions
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<glm::mat4> models; - std::vector<glm::vec4> textures; - std::vector<glm::vec3> colors; +struct RendererSectionData { + std::vector<glm::mat4> models; + std::vector<glm::vec4> textures; + std::vector<glm::vec3> 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<GLuint, int> refCounterVbo; static std::map<GLuint, int> 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 |