Graphics Reference
In-Depth Information
Table 6-2
Buffer Usage (continued)
Buffer Usage Enum
Description
GL_STREAM_DRAW
The buffer object data will be modified once and used
only a few times to draw primitives or specify images.
GL_STREAM_READ
The buffer object data will be modified once and used
only a few times to read data back from OpenGL ES.
The data read back from OpenGL ES will be queried for
from the application.
GL_STREAM_COPY
The buffer object data will be modified once and used
only a few times to read data back from OpenGL ES.
The data read back from OpenGL ES will be used
directly as a source to draw primitives or specify
images.
As mentioned earlier, GL_BUFFER_USAGE is a hint to OpenGL ES—not a
guarantee. Therefore, an application could allocate a buffer object data
store with usage set to GL_STATIC_DRAW and frequently modify it.
The vertex array data or element array data storage is created and
initialized using the glBufferData command.
void glBufferData (GLenum target , GLsizeiptr size ,
const void * data , GLenum usage )
target
can be set to any of the following targets:
GL_ARRAY_BUFFER
GL_ELEMENT_ARRAY_BUFFER
GL_COPY_READ_BUFFER
GL_COPY_WRITE_BUFFER
GL_PIXEL_PACK_BUFFER
GL_PIXEL_UNPACK_BUFFER
GL_TRANSFORM_FEEDBACK_BUFFER
GL_UNIFORM_BUFFER
size
size of buffer data store in bytes
data
pointer to the buffer data supplied by the application
usage
a hint on how the application will use the data stored in
the buffer object (refer to Table 6-2 for details)
 
 
Search WWH ::




Custom Search