summaryrefslogtreecommitdiffstats
path: root/src/RendererSection.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-08-16 17:11:07 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-08-16 17:11:07 +0200
commitdee50239be8fff566b3ca687bc70900b391a8164 (patch)
tree6ff6ae2e8e2ea5109d031be8c588f4b8f38f68eb /src/RendererSection.cpp
parent2017-08-12 (diff)
downloadAltCraft-dee50239be8fff566b3ca687bc70900b391a8164.tar
AltCraft-dee50239be8fff566b3ca687bc70900b391a8164.tar.gz
AltCraft-dee50239be8fff566b3ca687bc70900b391a8164.tar.bz2
AltCraft-dee50239be8fff566b3ca687bc70900b391a8164.tar.lz
AltCraft-dee50239be8fff566b3ca687bc70900b391a8164.tar.xz
AltCraft-dee50239be8fff566b3ca687bc70900b391a8164.tar.zst
AltCraft-dee50239be8fff566b3ca687bc70900b391a8164.zip
Diffstat (limited to 'src/RendererSection.cpp')
-rw-r--r--src/RendererSection.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/RendererSection.cpp b/src/RendererSection.cpp
index 439fab1..a2d6825 100644
--- a/src/RendererSection.cpp
+++ b/src/RendererSection.cpp
@@ -123,7 +123,7 @@ RendererSection::~RendererSection() {
refCounterVbo[VboModels]--;
refCounterVbo[VboColors]--;
refCounterVao[Vao]--;
- if (refCounterVbo[VboTextures] <= 0)
+ /*if (refCounterVbo[VboTextures] <= 0)
glDeleteBuffers(1, &VboTextures);
if (refCounterVbo[VboModels] <= 0)
@@ -132,12 +132,13 @@ RendererSection::~RendererSection() {
glDeleteBuffers(1, &VboColors);
if (refCounterVao[Vao] <= 0)
- glDeleteVertexArrays(1, &Vao);
+ glDeleteVertexArrays(1, &Vao);*/
}
void RendererSection::Render(RenderState &renderState) {
if (!isEnabled) return;
if (!models.empty()) {
+ LOG(INFO) << "Rendering unready section";
PrepareRender();
}
renderState.SetActiveVao(Vao);
@@ -332,15 +333,15 @@ void RendererSection::PrepareResources() {
void RendererSection::PrepareRender() {
glBindBuffer(GL_ARRAY_BUFFER, VboTextures);
glBufferData(GL_ARRAY_BUFFER, textures.size() * sizeof(glm::vec4), textures.data(), GL_DYNAMIC_DRAW);
- textures.clear();
+ std::vector<glm::vec4>().swap(textures);
glBindBuffer(GL_ARRAY_BUFFER, VboModels);
glBufferData(GL_ARRAY_BUFFER, models.size() * sizeof(glm::mat4), models.data(), GL_DYNAMIC_DRAW);
- models.clear();
+ std::vector<glm::mat4>().swap(models);
glBindBuffer(GL_ARRAY_BUFFER, VboColors);
glBufferData(GL_ARRAY_BUFFER, colors.size() * sizeof(glm::vec3), colors.data(), GL_DYNAMIC_DRAW);
- colors.clear();
+ std::vector<glm::vec3>().swap(colors);
glBindBuffer(GL_ARRAY_BUFFER, 0);
}