diff --git a/CMakeLists.txt b/CMakeLists.txt index 629a7d8f..4370b409 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/src/graphics/graphics.c b/src/graphics/graphics.c index eba11eb9..532c9bf0 100644 --- a/src/graphics/graphics.c +++ b/src/graphics/graphics.c @@ -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; diff --git a/src/graphics/opengl.c b/src/graphics/opengl.c index e71f734b..7f5be841 100644 --- a/src/graphics/opengl.c +++ b/src/graphics/opengl.c @@ -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; }