UNPKG

gl-to-dtype

Version:

turns a gl type into a dtype string

17 lines (16 loc) 632 B
module.exports = glToType function glToType (flag) { switch (flag) { case 5126: return 'float32' // gl.FLOAT case 5125: return 'uint32' // gl.UNSIGNED_INT case 5124: return 'int32' // gl.INT case 5123: return 'uint16' // gl.UNSIGNED_SHORT case 32819: return 'uint16' // gl.UNSIGNED_SHORT_4_4_4_4 case 32820: return 'uint16' // gl.UNSIGNED_SHORT_5_5_5_1 case 33635: return 'uint16' // gl.UNSIGNED_SHORT_5_6_5 case 5122: return 'int16' // gl.SHORT case 5121: return 'uint8' // gl.UNSIGNED_BYTE case 5120: return 'int8' // gl.BYTE default: return null } }