From 04ab1a3420b46af046a898ee5510e0d9b25ed24c Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Sun, 27 Aug 2017 20:24:28 +0500 Subject: 2017-08-27 --- src/RendererSection.hpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'src/RendererSection.hpp') diff --git a/src/RendererSection.hpp b/src/RendererSection.hpp index 9e5fd99..12a169e 100644 --- a/src/RendererSection.hpp +++ b/src/RendererSection.hpp @@ -23,19 +23,28 @@ struct RendererSectionData { RendererSectionData(World *world, Vector sectionPosition); }; - class RendererSection { - GLuint Vao, VboTextures, VboModels, VboColors, VboLights; + enum Vbos { + MODELS = 0, + TEXTURES, + COLORS, + LIGHTS, + VBOCOUNT, + }; + GLuint Vao = { 0 }; + GLuint Vbo[VBOCOUNT] = { 0 }; static GLuint VboVertices, VboUvs; - static std::map refCounterVbo; - static std::map refCounterVao; size_t hash; Vector sectionPos; + + RendererSection(const RendererSection &other) = delete; public: RendererSection(RendererSectionData data); - RendererSection(const RendererSection &other); + + RendererSection(RendererSection &&other); + ~RendererSection(); void Render(RenderState &renderState); @@ -44,5 +53,7 @@ public: size_t GetHash(); - size_t numOfFaces = 0; + size_t numOfFaces; + + friend void swap(RendererSection &lhs, RendererSection &rhs); }; \ No newline at end of file -- cgit v1.2.3