Issues

Issue #92 resolved

Chapter 3 - GL_STREAM_DRAW

Anonymous created an issue

Hey,

In chapter 3 you say that GL_STREAM_DRAW is to be optimized for multiple data changes. But according to the 3.3 spec it is a hint to tell the implementation that the data is to be written once and only used a few times at most. I guess you mean GL_DYNAMIC_DRAW. I hope this helps. Btw awesome tutorial.

Comments (1)

  1. Jason McKesson repo owner

    Thank you for the commentary.

    GL_STREAM_DRAW is for when you want to completely respecify the buffer's storage frequently. And the code does so with glBufferData. The OpenGL Wiki page on buffer object usage hints explains this more, as does the wiki article on streaming.

    Even the ARB_vertex_buffer_object specification shows this particular usage pattern as an example, and it uses GL_STREAM_DRAW. Look for "Vertex arrays using a mapped buffer object"; that section shows it respecifying the buffer each frame. And it does so with STREAM, not DYNAMIC.

    When it says "uses it at most a few times", it's talking about how frequently you use the storage before allocating new storage. Not the buffer object name itself.

  2. Log in to comment