Fix CMakeLists; Fix buffer unmapping; Formatting;

This commit is contained in:
bjorn 2019-05-18 01:09:06 -07:00
parent e3e52a7808
commit 1792f066f2
3 changed files with 4 additions and 2 deletions

View File

@ -361,6 +361,8 @@ if(LOVR_ENABLE_AUDIO)
add_definitions(-DLOVR_ENABLE_AUDIO)
target_sources(lovr PRIVATE
src/audio/audio.c
src/audio/source.c
src/audio/microphone.c
src/api/audio.c
src/api/types/source.c
src/api/types/microphone.c

View File

@ -603,7 +603,6 @@ void lovrGraphicsFlush() {
lovrBufferUnmap(state.buffers[i]);
}
for (int b = 0; b < batchCount; b++) {
Batch* batch = &state.batches[b];
BatchParams* params = &batch->params;

View File

@ -1616,7 +1616,8 @@ void lovrBufferUnmap(Buffer* buffer) {
glFlushMappedBufferRange(convertBufferType(buffer->type), buffer->flushFrom, buffer->flushTo - buffer->flushFrom);
}
if (!GLAD_GL_ARB_buffer_storage) {
if (!GLAD_GL_ARB_buffer_storage && buffer->mapped) {
lovrGpuBindBuffer(buffer->type, buffer->id);
glUnmapBuffer(convertBufferType(buffer->type));
buffer->mapped = false;
}