MCPcopy Create free account
hub / github.com/nwutils/nw-sample-apps / initDirectBuffers

Function initDirectBuffers

webgl/js/three.min.js:15653–15678  ·  view source on GitHub ↗
( geometry )

Source from the content-addressed store, hash-verified

15651 //
15652
15653 function initDirectBuffers( geometry ) {
15654
15655 var a, attribute, type;
15656
15657 for ( a in geometry.attributes ) {
15658
15659 if ( a === "index" ) {
15660
15661 type = _gl.ELEMENT_ARRAY_BUFFER;
15662
15663 } else {
15664
15665 type = _gl.ARRAY_BUFFER;
15666
15667 }
15668
15669 attribute = geometry.attributes[ a ];
15670
15671 attribute.buffer = _gl.createBuffer();
15672
15673 _gl.bindBuffer( type, attribute.buffer );
15674 _gl.bufferData( type, attribute.array, _gl.STATIC_DRAW );
15675
15676 }
15677
15678 };
15679
15680 // Buffer setting
15681

Callers 1

addObjectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected