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

Function getPrimitiveCount

docs/app/js/sanddance-app.js:65267–65286  ·  view source on GitHub ↗
(_ref)

Source from the content-addressed store, hash-verified

65265 }
65266}
65267function getPrimitiveCount(_ref) {
65268 var drawMode = _ref.drawMode, vertexCount = _ref.vertexCount;
65269 switch(drawMode){
65270 case GL_POINTS:
65271 case GL_LINE_LOOP:
65272 return vertexCount;
65273 case GL_LINES:
65274 return vertexCount / 2;
65275 case GL_LINE_STRIP:
65276 return vertexCount - 1;
65277 case GL_TRIANGLES:
65278 return vertexCount / 3;
65279 case GL_TRIANGLE_STRIP:
65280 case GL_TRIANGLE_FAN:
65281 return vertexCount - 2;
65282 default:
65283 (0, _utils.assert)(false);
65284 return 0;
65285 }
65286}
65287function getVertexCount(_ref2) {
65288 var drawMode = _ref2.drawMode, vertexCount = _ref2.vertexCount;
65289 var primitiveCount = getPrimitiveCount({

Callers 1

getVertexCountFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected