title: OpenGL VBO only being uploaded to GPU when rendered
body: <p>My VBOs are only being sent to the GPU when they are used for the first time, this causes small freezes the first time an object/group of objects is drawn.</p>
  
  <p>I tried loading the data this way:</p>
  
  <pre><code>glBufferData(GL_ARRAY_BUFFER, size, NULL, GL_STATIC_DRAW);
  glBufferSubData(GL_ARRAY_BUFFER, 0, size, data);
  </code></pre>
  
  <p>and this way</p>
  
  <pre><code>glBufferData(GL_ARRAY_BUFFER, size, data, GL_STATIC_DRAW);
  </code></pre>
  
  <p>But the result is the same. </p>
  
  <p>If I then draw a triangle after glBufferData:</p>
  
  <pre><code>glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_BYTE, NULL);
  </code></pre>
  
  <p>then the problem is solved, but I find this solution rather hackish.</p>
  
  <p>Is there a better solution?</p>
  
  <p>(I have a bunch of small VBOs containing 256 vertices each)</p>