Added read-only const access to buffers

Former-commit-id: 555f079e277869bc8f32732f24dfee704e17f324
This commit is contained in:
Lynix
2012-12-31 11:12:45 +01:00
parent e32e012c5a
commit 6fefa3fdd2
6 changed files with 66 additions and 6 deletions

View File

@@ -151,12 +151,25 @@ void* NzVertexBuffer::Map(nzBufferAccess access, unsigned int offset, unsigned i
return m_buffer->Map(access, m_startVertex+offset, (length) ? length : m_vertexCount-offset);
}
const void* NzVertexBuffer::Map(nzBufferAccess access, unsigned int offset, unsigned int length) const
{
#if NAZARA_UTILITY_SAFE
if (offset+length > m_vertexCount)
{
NazaraError("Exceeding virtual buffer size");
return nullptr;
}
#endif
return m_buffer->Map(access, m_startVertex+offset, (length) ? length : m_vertexCount-offset);
}
bool NzVertexBuffer::SetStorage(nzBufferStorage storage)
{
return m_buffer->SetStorage(storage);
}
bool NzVertexBuffer::Unmap()
bool NzVertexBuffer::Unmap() const
{
return m_buffer->Unmap();
}