March 2013
Intermediate to advanced
984 pages
26h 18m
English
The data parameter to glTexSubImage2D() may be interpreted in one of two ways. The first is as a natural pointer to data stored in the application’s memory. This is the use case shown in Example 6.2. data is interpreted this way if no buffer object is bound to the GL_PIXEL_UNPACK_BUFFER target. The second interpretation of data, which is used when there is a buffer bound to the GL_PIXEL_UNPACK_BUFFER target, is as an offset into that buffer object. This allows the application to stage data into a buffer object and transfer it from there into a texture object at a later time.
Example 6.3. Loading Data into a Texture Using a Buffer Object
// First, bind a buffer to the GL_PIXEL_UNPACK_BUFFER ...