I tried to fill a buffer with data before I had called bindBuffer
const triangleBuffer = context.createBuffer();
// context.bindBuffer(context.ARRAY_BUFFER, triangleBuffer);
context.bufferData(context.ARRAY_BUFFER, triangleVertices, context.STATIC_DRAW);
Then I got an error:
WebGL: INVALID_OPERATION: bufferData: no buffer
I created the buffer in the first line and I don't understand why I can't fill it with data.
Can't I just fill created buffer before binding to context.ARRAY_BUFFER
? Are there any reasons for this behaviour?