From bb162b9edd4b8c0e9faeed75da4148f5b9735450 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 25 Apr 2018 14:53:33 +0300 Subject: [PATCH] Check for OES_mapbuffer in Buffer::unmap It might have been mapped through ARB_map_buffer_range, in which case OES_mapbuffer didn't get initialized in Buffer::map. --- source/buffer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/buffer.cpp b/source/buffer.cpp index 040ae8df..2b18d7d7 100644 --- a/source/buffer.cpp +++ b/source/buffer.cpp @@ -110,13 +110,16 @@ void *Buffer::map(BufferAccess access) bool Buffer::unmap() { + // TODO check if it's mapped if(ARB_direct_state_access) return glUnmapNamedBuffer(id); - else + else if(OES_mapbuffer) { BindRestore _bind(this, type); return glUnmapBuffer(type); } + else + return true; } void Buffer::bind_to(BufferType t) const -- 2.45.2