| 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 | |