(and in the corresponding manner for namedBufferData)
This allows passing slices using bufferData(target, T, slice.len, slice.ptr, usage), and allows creating uninitialized buffers using bufferData(target, T, length, null, usage).
This has the disadvantage that the API becomes less clear for the usual case. Another alternative would be to create a separate wrapper function for creating uninitialized buffers, but this seems cluttered to me.
A null pointer can be used to create an uninitialized buffer, however zgl's wrappers do not support this. I propose changing the signatures like this:
(and in the corresponding manner for
namedBufferData
)This allows passing slices using
bufferData(target, T, slice.len, slice.ptr, usage)
, and allows creating uninitialized buffers usingbufferData(target, T, length, null, usage)
.This has the disadvantage that the API becomes less clear for the usual case. Another alternative would be to create a separate wrapper function for creating uninitialized buffers, but this seems cluttered to me.