MCPcopy Create free account
hub / github.com/comaps/comaps / UpdateBuffer

Method UpdateBuffer

libs/drape/mesh_object.hpp:67–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65
66 template <typename T>
67 void UpdateBuffer(ref_ptr<dp::GraphicsContext> context, uint32_t bufferInd, std::vector<T> const & vertices)
68 {
69 CHECK(m_initialized, ());
70 CHECK_LESS(bufferInd, static_cast<uint32_t>(m_buffers.size()), ());
71 CHECK(!vertices.empty(), ());
72
73 auto & buffer = m_buffers[bufferInd];
74 CHECK_LESS_OR_EQUAL(static_cast<uint32_t>(vertices.size() * sizeof(T)), buffer->GetSizeInBytes(), ());
75 memcpy(buffer->GetData(), vertices.data(), vertices.size() * sizeof(T));
76
77 UpdateImpl(context, bufferInd);
78 }
79
80 void SetIndexBuffer(std::vector<uint16_t> && indices);
81 void UpdateIndexBuffer(ref_ptr<dp::GraphicsContext> context, std::vector<uint16_t> const & indices);

Callers 3

RenderMethod · 0.45
SetArrowMethod · 0.45
SetRectMethod · 0.45

Calls 5

GetSizeInBytesMethod · 0.80
sizeMethod · 0.45
emptyMethod · 0.45
GetDataMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected