title: How to handle GL_OUT_OF_MEMORY error during glBufferData?
body: <p>The OpenGL reference mentions about the <code>GL_OUT_OF_MEMORY</code> error</p>
  
  <blockquote>
    <p>The state of the GL is undefined, except for the state of the error flags, after this error is recorded.</p>
  </blockquote>
  
  <p>The function <code>glBufferData</code> can generate this error if it can't digest the given data. But on the other hand the API doesn't seem to provide any way to check if sending data of particular size would succeed.</p>
  
  <p>Is this situation really hopeless? If I get this error, is the only thing left for me to recreate the whole OpenGL context and start over?</p>