From 9e56348975dbdaf1cce9dd688129208a61fd4eb5 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Fri, 21 Jul 2017 19:49:56 +0500 Subject: 2017-07-21 --- include/graphics/RenderSection.hpp | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'include/graphics/RenderSection.hpp') diff --git a/include/graphics/RenderSection.hpp b/include/graphics/RenderSection.hpp index 6a2f3ce..58c4acf 100644 --- a/include/graphics/RenderSection.hpp +++ b/include/graphics/RenderSection.hpp @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -21,21 +22,31 @@ public: class RenderSection { Vector sectionPosition; World *world; - GLuint Vao,VboBlocks,VboModels; + GLuint Vao, VboTextures, VboModels, VboColors; + std::vector models; + std::vector textures; + std::vector colors; - static GLuint VboVertices,VboUvs; - static std::map refCounterVbo; - static std::map refCounterVao; + static GLuint VboVertices, VboUvs; + static std::map refCounterVbo; + static std::map refCounterVao; - size_t numOfBlocks; + size_t numOfFaces = 0; + bool isEnabled = true; + + size_t hash = 0; public: RenderSection(World *world, Vector position); RenderSection(const RenderSection &other); ~RenderSection(); - void UpdateState(); + void UpdateState(const std::map &textureAtlas); void Render(RenderState &state); - Section* GetSection(); + void SetEnabled(bool isEnabled); + + Section *GetSection(); + + bool IsNeedUpdate(); }; \ No newline at end of file -- cgit v1.2.3