Jump to content
OpenGL API Specifications
Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 11 December 2012 - 07:24 PM
Posted 13 December 2012 - 11:57 AM
To fill all or part of an existing buffer object's data store with a constant value, call void ClearBufferSubData(enum target, enum internalformat, enum format, enum type, sizeiptr offset, sizeiptr size, const void * data); with <target> set to the target to which the destination buffer is bound. <target> must be one of the targets listed in Table 2.8. <internalformat> must be set to one of the format tokens listed in Table 3.15, "Internal formats for buffer textures". <format> and <type> specify the format and type of the source data and are interpreted as described in Section 3.7.2. <offset> set to the offset, measured in basic machine units, into the buffer object's data store from which to begin filling, and <size> set to the size, also in basic machine units, of the range to fill. Both <offset> and <range> must be multiples of the number of basic machine units per-element for that internal format specified by <internalformat>, otherwise the error INVALID_VALUE is generated. <data> is a pointer to an array of between one and four components containing the data to be used as the source of the constant fill value. The elements of <data> are converted by the GL into the format specified by <internalformat> in the manner described in section 2.3.1, and then used to fill the specified range of the destination buffer. If <data> is NULL, then the pointer is ignored and the sub-range of the buffer is filled with zeros. If <offset> or <size> is less than zero, or if <offset> + <size> is greater than the value of BUFFER_SIZE for the buffer bound to <target> then the error INVALID_VALUE is generated. The command An INVALID_OPERATION error is generated if any part of the specified range of the buffer bound to <target> is currently mapped. void ClearBufferData(enum target, enum internalformat, enum format, enum type, const void * data); is equivalent to calling ClearBufferSubData with <target>, <internalformat> and <data> as specified, with <offset> set to zero, and <size> set to the value of BUFFER_SIZE for the buffer bound to <target>.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.