mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-23 22:53:43 +00:00
committed by
Konstantin Pastbin
parent
c9cbb64f12
commit
76ffc99abd
25
libs/drape/index_buffer.cpp
Normal file
25
libs/drape/index_buffer.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include "drape/index_buffer.hpp"
|
||||
#include "drape/index_storage.hpp"
|
||||
|
||||
#include "base/assert.hpp"
|
||||
|
||||
namespace dp
|
||||
{
|
||||
IndexBuffer::IndexBuffer(uint32_t capacity)
|
||||
: DataBuffer((uint8_t)IndexStorage::SizeOfIndex(), capacity)
|
||||
{}
|
||||
|
||||
void IndexBuffer::UploadData(ref_ptr<GraphicsContext> context, void const * data, uint32_t size)
|
||||
{
|
||||
GetBuffer()->UploadData(context, data, size);
|
||||
}
|
||||
|
||||
void IndexBuffer::UpdateData(ref_ptr<GraphicsContext> context, void const * data, uint32_t size)
|
||||
{
|
||||
ASSERT_LESS_OR_EQUAL(size, GetBuffer()->GetCapacity(), ());
|
||||
|
||||
GetBuffer()->Seek(0);
|
||||
if (size > 0)
|
||||
UploadData(context, data, size);
|
||||
}
|
||||
} // namespace dp
|
||||
Reference in New Issue
Block a user