title: Drawing thousands of lines in OpenGL
body: <p>I've been trying to find a way to draw thousands of lines in opengl and take as little performance loss as possible. I have to draw beteewn 10000 to 100000 unconnected lines with 21 points each, and I'm not sure how to go about this issue. From what I've found on the web I should try to minimize the overhead of drawing calls and also not to constantly send data to the gpu. Until now I've tried a few things:</p>
  
  <ul>
  <li>Using just one VBO for everything.</li>
  </ul>
  
  <p>This way I just send the data once, but end up having draw calls for each line separated by 21 points like glDrawArrays(GL_LINE_STRIP, <strong><em>i</em></strong> * 21, 21) where I iterate over <strong><em>i</em></strong> for the amount of lines. Though this kinda works, but it seems like there could be an easier, more elegant solution, without that many draw calls.</p>
  
  <ul>
  <li>Using diferent VBOs for each line.</li>
  </ul>
  
  <p>I didn't really think this was a good idea, it gets really messy and end up having just as many draw calls.</p>
  
  <p><strong>Is there a way to draw thousands of lines with one draw call?, and if not, how should I go about this issue?</strong></p>
  
  <p>I'm using OpenGL 3.3.</p>