title: OpenGL using std::vector with glm::vec3
body: <p>I'm having the following issue. </p>
  
  <p>I've loaded 8 glm::vec3 into a std::vector, such that:  </p>
  
  <pre><code>std::vector &lt;glm::vec3&gt; vertices;
  </code></pre>
  
  <p>returns:  </p>
  
  <p><strong>0.250000 -0.250000 -0.250000<br>
  0.250000 -0.250000 0.250000<br>
  -0.250000 -0.250000 0.250000<br>
  -0.250000 -0.250000 -0.250000<br>
  0.250000 0.250000 -0.250000<br>
  0.250000 0.250000 0.250000<br>
  -0.250000 0.250000 0.250000<br>
  -0.250000 0.250000 -0.250000</strong>  </p>
  
  <p>if:  </p>
  
  <pre><code>for(int i{0}; i&lt;8; i++){
      std::cout&lt;&lt;"\n";
      for(int j{0}; j&lt;3; j++){
      std::cout&lt;&lt;vertices[i][j]&lt;&lt;" ";
      }
  }
  </code></pre>
  
  <p>When I pass the following code into OpenGL, </p>
  
  <pre><code>glBufferData(GL_ARRAY_BUFFER, sizeof(glm::vec3) * vertices.size(), &amp;vertices[0],  GL_DYNAMIC_DRAW);  
  
  glEnableVertexAttribArray(0);
  glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0); 
  
  glBindVertexArray(buffer);  
  </code></pre>
  
  <p>my shader program loads and the window opens, however there is no cube.  </p>
  
  <p>A slight alteration to the first line, </p>
  
  <pre><code>glBufferData(GL_ARRAY_BUFFER, sizeof(vert), &amp;vert, GL_DYNAMIC_DRAW); //Here
  
  glEnableVertexAttribArray(0);
  glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
  
  glBindVertexArray(buffer); 
  </code></pre>
  
  <p>while taking vectors from,</p>
  
  <pre><code>const GLfloat vert[9] =
  {-0.5,-0.5, 0.0,
    0.0, 0.5, 0.0,
    0.5,-0.5, 0.0};
  </code></pre>
  
  <p>and a pretty red triangle is drawn onto the screen.</p>
  
  <p><strong>My question:</strong> <em>Is it possible to use a vector container in combination with glm? If so, how can it be implemented?</em><br>
  <strong>My hypothesis:</strong><em>The glVertexAttribPointer function is reading sequentially from the starting address of the vertices container. The elements of the vertices container are fragmented throughout my memory.</em></p>