Fix mesh mapping;

This commit is contained in:
bjornbytes 2017-06-13 22:59:27 -07:00
parent 6c25b9bd4f
commit 5f3ce18fcd
1 changed files with 2 additions and 1 deletions

View File

@ -281,7 +281,7 @@ void* lovrMeshMap(Mesh* mesh, int start, int count) {
mesh->isMapped = 1;
mesh->mapStart = start;
mesh->mapCount = count;
GLbitfield access = GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_RANGE_BIT;
GLbitfield access = GL_MAP_READ_BIT | GL_MAP_WRITE_BIT;
glBindBuffer(GL_ARRAY_BUFFER, mesh->vbo);
return glMapBufferRange(GL_ARRAY_BUFFER, start * mesh->stride, count * mesh->stride, access);
}
@ -299,6 +299,7 @@ void lovrMeshUnmap(Mesh* mesh) {
if (mesh->isMapped) {
mesh->isMapped = 0;
glBindBuffer(GL_ARRAY_BUFFER, mesh->vbo);
glUnmapBuffer(GL_ARRAY_BUFFER);
}
}