Files
cocos4/jsb/input-assembler.js
T
2018-04-18 17:01:46 +08:00

26 lines
498 B
JavaScript

class InputAssembler {
constructor(vb, ib, pt = gfx.PT_TRIANGLES) {
this._vertexBuffer = vb;
this._indexBuffer = ib;
this._primitiveType = pt;
this._start = 0;
this._count = -1;
// TODO: instancing data
// this._stream = 0;
}
getPrimitiveCount () {
if (this._count !== -1) {
return this._count;
}
if (this._indexBuffer) {
return this._indexBuffer.count;
}
return this._vertexBuffer.count;
}
}
module.exports = InputAssembler;