-
- if (needs_pbo_recreate) {
- // The pitch has changed; we need to reallocate this PBO.
- glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB, pitch[channel] * heights[channel], NULL, GL_STREAM_DRAW);
- check_error();
- }
-
- void *mapped_pbo = glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, GL_WRITE_ONLY);
- memcpy(mapped_pbo, pixel_data[channel], pitch[channel] * heights[channel]);
-
- glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB);