drawPerspectiveScene = (gl, programInfo, buffers) => {
gl.clearColor(0.0, 0.0, 0.0, 1.0);
gl.clearDepth(1.0);
gl.enable(gl.DEPTH_TEST);
gl.depthFunc(gl.LEQUAL);
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
const {
program,
uniformLocations: {
projectionMatrix: projectionMatrixLocation,
modelViewMatrix: modelViewMatrixLocation
},
attribLocations: { vertexPosition }
} = programInfo;
setPositionAttribute(gl, buffers.position, vertexPosition);
gl.useProgram(program);
setPerspectiveUniforms(gl, projectionMatrixLocation, modelViewMatrixLocation);
const offset = 0;
const numVertices = 4;
gl.drawArrays(gl.TRIANGLE_STRIP, offset, numVertices);
}