The change in ecc8a3a introduced an error in vertex attribute pointer setup, and thus rendering.
In that commit, the two calls to gl.vertexAttribPointer after the bind call of each shape's GLBuffer are replace by a single call to shader.attributes.aPosition.pointer, before either buffer bind. This resulted in the triangle being rendered with the first 3 "rows" of the square's vertex buffer. This visually manifests as a right triangle being rendered, not an isosceles.
This PR just adds a call to pointer after each vertex buffer's bind call. I'm new to both the gl-* libraries and Open/WebGL generally, so if there's a nicer way to do this, let me know, and I'll update the PR!
The change in ecc8a3a introduced an error in vertex attribute pointer setup, and thus rendering.
In that commit, the two calls to
gl.vertexAttribPointer
after thebind
call of each shape'sGLBuffer
are replace by a single call toshader.attributes.aPosition.pointer
, before either bufferbind
. This resulted in the triangle being rendered with the first 3 "rows" of the square's vertex buffer. This visually manifests as a right triangle being rendered, not an isosceles.This PR just adds a call to
pointer
after each vertex buffer'sbind
call. I'm new to both thegl-*
libraries and Open/WebGL generally, so if there's a nicer way to do this, let me know, and I'll update the PR!