I am trying to write functions that can draw generic shapes without textures. This includes a system for primitive polygon shapes, but as an example I will use show my rectangle function:
void Rectangle(float x1, float y1, float x2, float y2);
I am not sure how to best handle this given that all of my rendering uses VAOs. My current line of thought is to use one VAO with a single VBO attached to it and edit this VBO every time one of these functions is called. So for the rectangle example I will simply bind the buffer and call glBufferData passing in an array with the parameters for the points of the rectangle, then pass the vertex array onto the rest of my rendering system.
What I can't find information about is whether the VAO stores a reference to the buffer or makes an internal copy of the data based on the buffer and format. Is it ok to edit the buffer every time I am about to draw with it's VAO and if so do I have to call glVertexAttribPointer every time?