summaryrefslogtreecommitdiffhomepage
path: root/src/rlgl.h
diff options
context:
space:
mode:
authorChang Si Yuan <[email protected]>2020-06-08 16:31:39 +0800
committerGitHub <[email protected]>2020-06-08 10:31:39 +0200
commit73cc33b4939ec3c795e76af50f1a7314583be117 (patch)
tree52a2d37e4f49b34a93c80891ebf39dda70490470 /src/rlgl.h
parent87592e2625573ef151843a52b34acec35762d3ff (diff)
downloadraylib-73cc33b4939ec3c795e76af50f1a7314583be117.tar.gz
raylib-73cc33b4939ec3c795e76af50f1a7314583be117.zip
Fix extra memory allocated when updating color buffer in mesh (#1271)
Diffstat (limited to 'src/rlgl.h')
-rw-r--r--src/rlgl.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rlgl.h b/src/rlgl.h
index af3dbced..e6ec4b7c 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -2587,7 +2587,7 @@ void rlUpdateMeshAt(Mesh mesh, int buffer, int count, int index)
case 3: // Update colors (vertex colors)
{
glBindBuffer(GL_ARRAY_BUFFER, mesh.vboId[3]);
- if (index == 0 && count >= mesh.vertexCount) glBufferData(GL_ARRAY_BUFFER, count*4*sizeof(float), mesh.colors, GL_DYNAMIC_DRAW);
+ if (index == 0 && count >= mesh.vertexCount) glBufferData(GL_ARRAY_BUFFER, count*4*sizeof(unsigned char), mesh.colors, GL_DYNAMIC_DRAW);
else if (index + count >= mesh.vertexCount) break;
else glBufferSubData(GL_ARRAY_BUFFER, index*4*sizeof(unsigned char), count*4*sizeof(unsigned char), mesh.colors);