MCPcopy Create free account
hub / github.com/microsoft/SandDance / getPrimitiveCount

Function getPrimitiveCount

docs/tests/v2/es6/js/sanddance.js:12426–12452  ·  view source on GitHub ↗
(_ref)

Source from the content-addressed store, hash-verified

12424
12425
12426function getPrimitiveCount(_ref) {
12427 var drawMode = _ref.drawMode,
12428 vertexCount = _ref.vertexCount;
12429
12430 switch (drawMode) {
12431 case GL_POINTS:
12432 case GL_LINE_LOOP:
12433 return vertexCount;
12434
12435 case GL_LINES:
12436 return vertexCount / 2;
12437
12438 case GL_LINE_STRIP:
12439 return vertexCount - 1;
12440
12441 case GL_TRIANGLES:
12442 return vertexCount / 3;
12443
12444 case GL_TRIANGLE_STRIP:
12445 case GL_TRIANGLE_FAN:
12446 return vertexCount - 2;
12447
12448 default:
12449 (0, _assert.default)(false);
12450 return 0;
12451 }
12452} // Counts the number of vertices after splitting the vertex stream into separate "primitives"
12453
12454
12455function getVertexCount(_ref2) {

Callers 1

getVertexCountFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected