throw buffer_too_small(format("buffer has %d bytes; %d required", size, req_sz));
}
+void *Buffer::map()
+{
+ if(!can_map() || mapped)
+ throw invalid_operation("Buffer::map");
+ void *result = BufferBackend::map();
+ mapped = true;
+ return result;
+}
+
+bool Buffer::unmap()
+{
+ if(!can_map() || !mapped)
+ throw invalid_operation("Buffer::map");
+ bool result = BufferBackend::unmap();
+ mapped = false;
+ return result;
+}
+
} // namespace GL
} // namespace Msp