diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2019-01-27 14:57:47 +0100 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2019-01-27 15:06:37 +0100 |
commit | b57a26a7112d19fdee27c99028092463e550119c (patch) | |
tree | 132863eab01c9f22727bc9057da4d1bf3eb4015d /src/RendererSection.cpp | |
parent | Basic animated textures support (diff) | |
download | AltCraft-b57a26a7112d19fdee27c99028092463e550119c.tar AltCraft-b57a26a7112d19fdee27c99028092463e550119c.tar.gz AltCraft-b57a26a7112d19fdee27c99028092463e550119c.tar.bz2 AltCraft-b57a26a7112d19fdee27c99028092463e550119c.tar.lz AltCraft-b57a26a7112d19fdee27c99028092463e550119c.tar.xz AltCraft-b57a26a7112d19fdee27c99028092463e550119c.tar.zst AltCraft-b57a26a7112d19fdee27c99028092463e550119c.zip |
Diffstat (limited to 'src/RendererSection.cpp')
-rw-r--r-- | src/RendererSection.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/RendererSection.cpp b/src/RendererSection.cpp index bbf24ff..1521c6f 100644 --- a/src/RendererSection.cpp +++ b/src/RendererSection.cpp @@ -81,6 +81,14 @@ RendererSection::RendererSection(const RendererSectionData &data) { glVertexAttribDivisor(layerAttribPos, 1); glCheckError(); + //TextureFrames + GLuint framesAttribPos = 15; + glBindBuffer(GL_ARRAY_BUFFER, Vbo[FRAMES]); + glVertexAttribPointer(framesAttribPos, 1, GL_FLOAT, GL_FALSE, sizeof(GLfloat), nullptr); + glEnableVertexAttribArray(framesAttribPos); + glVertexAttribDivisor(framesAttribPos, 1); + glCheckError(); + //Blocks models GLuint matAttribPos = 8; size_t sizeOfMat4 = 4 * 4 * sizeof(GLfloat); @@ -167,6 +175,9 @@ void RendererSection::UpdateData(const RendererSectionData & data) { glBindBuffer(GL_ARRAY_BUFFER, Vbo[LAYERS]); glBufferData(GL_ARRAY_BUFFER, data.textureLayers.size() * 1* sizeof(GLfloat), data.textureLayers.data(), GL_DYNAMIC_DRAW); + glBindBuffer(GL_ARRAY_BUFFER, Vbo[FRAMES]); + glBufferData(GL_ARRAY_BUFFER, data.textureFrames.size() * 1 * sizeof(GLfloat), data.textureFrames.data(), GL_DYNAMIC_DRAW); + glBindBuffer(GL_ARRAY_BUFFER, Vbo[MODELS]); glBufferData(GL_ARRAY_BUFFER, data.models.size() * sizeof(glm::mat4), data.models.data(), GL_DYNAMIC_DRAW); |