mirror of https://github.com/bjornbytes/lovr.git
Fix mesh mapping;
This commit is contained in:
parent
6c25b9bd4f
commit
5f3ce18fcd
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue