summaryrefslogtreecommitdiffstats
path: root/src/RendererSection.hpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-08-27 17:24:28 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-01-13 03:39:28 +0100
commit04ab1a3420b46af046a898ee5510e0d9b25ed24c (patch)
tree4e9d300bb38d434305d00337535c7c4077bc57c4 /src/RendererSection.hpp
parent2017-08-23 (diff)
downloadAltCraft-04ab1a3420b46af046a898ee5510e0d9b25ed24c.tar
AltCraft-04ab1a3420b46af046a898ee5510e0d9b25ed24c.tar.gz
AltCraft-04ab1a3420b46af046a898ee5510e0d9b25ed24c.tar.bz2
AltCraft-04ab1a3420b46af046a898ee5510e0d9b25ed24c.tar.lz
AltCraft-04ab1a3420b46af046a898ee5510e0d9b25ed24c.tar.xz
AltCraft-04ab1a3420b46af046a898ee5510e0d9b25ed24c.tar.zst
AltCraft-04ab1a3420b46af046a898ee5510e0d9b25ed24c.zip
Diffstat (limited to 'src/RendererSection.hpp')
-rw-r--r--src/RendererSection.hpp23
1 files changed, 17 insertions, 6 deletions
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<GLuint, int> refCounterVbo;
- static std::map<GLuint, int> 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