I'm trying to convert Opengl ES code to javascript. I have strange error
Error: WebGL: vertexAttribPointer: must have valid GL_ARRAY_BUFFER binding
Error: WebGL: drawElements: must have element array buffer binding

Does it mean that I must use VBO for drawing? 
I use following code for drawing

glVertexAttribPointer(textCoordAttrib, 2, GL_FLOAT, 
GL_FALSE, sizeof(Vertex), &batch.vertices[0].textureCoordinates);
glVertexAttribPointer(colorAttrib, 4, GL_UNSIGNED_BYTE, GL_TRUE,  
sizeof(Vertex), 
&batch.vertices[0].color);
glVertexAttribPointer(vertexAttrib, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), 
&batch.vertices[0].position); 
glDrawElements(GL_TRIANGLE_STRIP, batch.indeces.size(), GL_UNSIGNED_SHORT, 
& batch.indeces[0]);

without any VBO.

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to