diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-07-21 16:49:56 +0200 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-07-21 16:49:56 +0200 |
commit | 9e56348975dbdaf1cce9dd688129208a61fd4eb5 (patch) | |
tree | 5a44a37cf0243c1ced14c222f35983eaaaa0185b /include/graphics/RenderSection.hpp | |
parent | 2017-06-21 (diff) | |
download | AltCraft-9e56348975dbdaf1cce9dd688129208a61fd4eb5.tar AltCraft-9e56348975dbdaf1cce9dd688129208a61fd4eb5.tar.gz AltCraft-9e56348975dbdaf1cce9dd688129208a61fd4eb5.tar.bz2 AltCraft-9e56348975dbdaf1cce9dd688129208a61fd4eb5.tar.lz AltCraft-9e56348975dbdaf1cce9dd688129208a61fd4eb5.tar.xz AltCraft-9e56348975dbdaf1cce9dd688129208a61fd4eb5.tar.zst AltCraft-9e56348975dbdaf1cce9dd688129208a61fd4eb5.zip |
Diffstat (limited to 'include/graphics/RenderSection.hpp')
-rw-r--r-- | include/graphics/RenderSection.hpp | 25 |
1 files changed, 18 insertions, 7 deletions
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 <glm/gtx/transform.hpp> #include <easylogging++.h> +#include <AssetManager.hpp> #include <world/Section.hpp> #include <world/World.hpp> @@ -21,21 +22,31 @@ public: class RenderSection { Vector sectionPosition; World *world; - GLuint Vao,VboBlocks,VboModels; + GLuint Vao, VboTextures, VboModels, VboColors; + std::vector<glm::mat4> models; + std::vector<glm::vec4> textures; + std::vector<glm::vec3> colors; - static GLuint VboVertices,VboUvs; - static std::map<GLuint,int> refCounterVbo; - static std::map<GLuint,int> refCounterVao; + static GLuint VboVertices, VboUvs; + static std::map<GLuint, int> refCounterVbo; + static std::map<GLuint, int> 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<BlockTextureId, glm::vec4> &textureAtlas); void Render(RenderState &state); - Section* GetSection(); + void SetEnabled(bool isEnabled); + + Section *GetSection(); + + bool IsNeedUpdate(); };
\ No newline at end of file |