Skip to content
Snippets Groups Projects
Commit 64d6e185 authored by Alexander Rose's avatar Alexander Rose
Browse files

createVertexArray tweaks

parent c8291d72
No related branches found
No related tags found
No related merge requests found
......@@ -13,11 +13,12 @@ export function createVertexArray(ctx: WebGLContext, program: Program, attribute
let vertexArray: WebGLVertexArrayObject | null = null
if (vertexArrayObject) {
vertexArray = vertexArrayObject.createVertexArray()
vertexArrayObject.bindVertexArray(vertexArray)
if (elementsBuffer) elementsBuffer.bind()
program.bindAttributes(attributeBuffers)
ctx.stats.vaoCount += 1
vertexArrayObject.bindVertexArray(null)
if (vertexArray) {
updateVertexArray(ctx, vertexArray, program, attributeBuffers, elementsBuffer)
ctx.stats.vaoCount += 1
} else {
console.warn('Could not create WebGL vertex array')
}
}
return vertexArray
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment