title: how to update vertex buffer data frequently (every frame) opengl
body: <p>I have a simple 2d triangle displayed on the screen, I want to update the color buffer data every frame, so the color of the triangle changes constantly, but im not sure how to update the data efficiently.</p>
  
  <p>this is the code for the color buffer:</p>
  
  <pre><code>GLfloat colourVert[] = {
          0.0f, 1.0f, 0.0f,
          1.0f, 0.0f, 0.0f,
          0.0f, 0.0f, 1.0f
      };
  
  
  
  GLuint colourBuffer;
  glGenBuffers(1, &amp;colourBuffer);
  glBindBuffer(GL_ARRAY_BUFFER, colourBuffer);
  glBufferData(GL_ARRAY_BUFFER, sizeof(colourVert), colourVert, GL_DYNAMIC_DRAW);
  glEnableVertexAttribArray(1);
  glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 0, 0);
  </code></pre>
  
  <p>Do I need to add something in these lines or do I need to modify the shaders, can someone explain please, thanks for any help.</p>