UNPKG

@animech-public/playcanvas

Version:
2 lines (1 loc) 450 B
import{INDEXFORMAT_UINT8 as t,INDEXFORMAT_UINT16 as o,INDEXFORMAT_UINT32 as s}from"../constants.js";import{WebglBuffer as r}from"./webgl-buffer.js";class e extends r{constructor(r){super();const e=r.device.gl,c=r.format;c===t?this.glFormat=e.UNSIGNED_BYTE:c===o?this.glFormat=e.UNSIGNED_SHORT:c===s&&(this.glFormat=e.UNSIGNED_INT)}unlock(t){const o=t.device;super.unlock(o,t.usage,o.gl.ELEMENT_ARRAY_BUFFER,t.storage)}}export{e as WebglIndexBuffer};