diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-08-17 17:11:52 +0200 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-08-17 17:11:52 +0200 |
commit | c71fd5f2312bc70eec960c2785bf26d73334d6c3 (patch) | |
tree | a2552e127d69db6385cf84846b74c70c646f88f1 /src/RendererSection.hpp | |
parent | 2017-08-16 (diff) | |
download | AltCraft-c71fd5f2312bc70eec960c2785bf26d73334d6c3.tar AltCraft-c71fd5f2312bc70eec960c2785bf26d73334d6c3.tar.gz AltCraft-c71fd5f2312bc70eec960c2785bf26d73334d6c3.tar.bz2 AltCraft-c71fd5f2312bc70eec960c2785bf26d73334d6c3.tar.lz AltCraft-c71fd5f2312bc70eec960c2785bf26d73334d6c3.tar.xz AltCraft-c71fd5f2312bc70eec960c2785bf26d73334d6c3.tar.zst AltCraft-c71fd5f2312bc70eec960c2785bf26d73334d6c3.zip |
Diffstat (limited to 'src/RendererSection.hpp')
-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 |