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

Method DrawPrimitives

libs/drape/mesh_object.cpp:266–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264}
265
266void MeshObject::DrawPrimitives(ref_ptr<dp::GraphicsContext> context)
267{
268 if (m_buffers.empty())
269 return;
270
271 auto const & buffer = m_buffers[0];
272 auto const vertexNum = buffer->GetSizeInBytes() / buffer->GetStrideInBytes();
273#ifdef DEBUG
274 for (size_t i = 1; i < m_buffers.size(); i++)
275 {
276 ASSERT_EQUAL(m_buffers[i]->GetSizeInBytes() / m_buffers[i]->GetStrideInBytes(), vertexNum,
277 ("All buffers in a mesh must contain the same vertex number"));
278 }
279#endif
280
281 CHECK(m_impl != nullptr, ());
282 if (m_indices.empty())
283 m_impl->DrawPrimitives(context, vertexNum, 0);
284 else
285 m_impl->DrawPrimitivesIndexed(context, static_cast<uint32_t>(m_indices.size()), 0);
286}
287
288void MeshObject::Unbind(ref_ptr<dp::GpuProgram> program)
289{

Callers 1

DrawPrimitivesSubsetMethod · 0.45

Calls 5

GetSizeInBytesMethod · 0.80
GetStrideInBytesMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45
DrawPrimitivesIndexedMethod · 0.45

Tested by

no test coverage detected