From: Mikko Rasa Date: Wed, 25 Apr 2018 11:53:33 +0000 (+0300) Subject: Check for OES_mapbuffer in Buffer::unmap X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=bb162b9edd4b8c0e9faeed75da4148f5b9735450;p=libs%2Fgl.git 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. --- 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