MCPcopy Create free account
hub / github.com/axmolengine/axmol / updateBuffer

Method updateBuffer

core/2d/Label.cpp:1937–1953  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1935}
1936
1937void Label::updateBuffer(TextureAtlas* textureAtlas, CustomCommand& customCommand)
1938{
1939 if (textureAtlas->getTotalQuads() > customCommand.getVertexCapacity())
1940 {
1941 customCommand.createVertexBuffer((unsigned int)sizeof(V3F_C4B_T2F_Quad),
1942 (unsigned int)textureAtlas->getTotalQuads(),
1943 CustomCommand::BufferUsage::DYNAMIC);
1944 customCommand.createIndexBuffer(CustomCommand::IndexFormat::U_SHORT,
1945 (unsigned int)textureAtlas->getTotalQuads() * 6,
1946 CustomCommand::BufferUsage::DYNAMIC);
1947 }
1948 customCommand.updateVertexBuffer(textureAtlas->getQuads(),
1949 (unsigned int)(textureAtlas->getTotalQuads() * sizeof(V3F_C4B_T2F_Quad)));
1950 customCommand.updateIndexBuffer(textureAtlas->getIndices(),
1951 (unsigned int)(textureAtlas->getTotalQuads() * 6 * sizeof(unsigned short)));
1952 customCommand.setIndexDrawInfo(0, (unsigned int)(textureAtlas->getTotalQuads() * 6));
1953}
1954
1955void Label::updateEffectUniforms(BatchCommand& batch,
1956 TextureAtlas* textureAtlas,

Callers

nothing calls this directly

Calls 6

getTotalQuadsMethod · 0.80
createVertexBufferMethod · 0.80
createIndexBufferMethod · 0.80
getQuadsMethod · 0.80
updateVertexBufferMethod · 0.45
updateIndexBufferMethod · 0.45

Tested by

no test coverage detected