void *Buffer::map()
{
- if(!can_map() || mapped)
+ if(size==0 || !can_map() || mapped)
throw invalid_operation("Buffer::map");
void *result = BufferBackend::map();
mapped = true;
bool Buffer::unmap()
{
- if(!can_map() || !mapped)
- throw invalid_operation("Buffer::map");
+ if(size==0 || !can_map() || !mapped)
+ throw invalid_operation("Buffer::unmap");
bool result = BufferBackend::unmap();
mapped = false;
return result;