func BufferSubData(target Enum, offset int, data []byte) { defer func() { errstr := errDrain() log.Printf("gl.BufferSubData(%v, %v, len(%d)) %v", target, offset, len(data), errstr) }() C.glBufferSubData(target.c(), C.GLintptr(offset), C.GLsizeiptr(len(data)), unsafe.Pointer(&data[0])) }
// BufferSubData uses glBufferSubData to update a section of the buffer // currently bound to target. The buffer's type is treated as being an array // of the same type as slice. Trying to set data off the end of the buffer // is not checked, and will likely result in a GL error. // // This function sets: // buffer_bound_to_target[start:start+len(slice)] = slice[:] func BufferSubData(target GLenum, start_index int, slice interface{}) error { data, e := sliceToUintptr(slice) if e != nil { return e } C.glBufferSubData(C.GLenum(target), C.GLintptr(uintptr(start_index)*data.Size), C.GLsizeiptr(data.Size*data.Length), unsafe.Pointer(data.Ptr)) return nil }
func BufferSubData( target Enum, offset IntPtr, size SizeiPtr, data Void) { C.glBufferSubData( C.GLenum(target), C.GLintptr(offset), C.GLsizeiptr(size), unsafe.Pointer(data)) }
func BufferSubData(target Enum, offset, size int, data unsafe.Pointer) { C.glBufferSubData(target.c(), C.GLintptr(offset), C.GLsizeiptr(size), data) }
func BufferSubDataf(target BufferTarget, offset int, data []float32) { C.glBufferSubData(C.GLenum(target), C.GLintptr(offset), C.GLsizeiptr(unsafe.Sizeof(data[0])*uintptr(len(data))), unsafe.Pointer(&data[0])) }
func CopyBufferSubData(readTarget, writeTarget BufferTarget, readOffset, writeOffset, size int) { C.glCopyBufferSubData(C.GLenum(readTarget), C.GLenum(writeTarget), C.GLintptr(readOffset), C.GLintptr(writeOffset), C.GLsizeiptr(size)) }
func BufferSubData(target uint, offset int, size int, data Void) { C.glBufferSubData( C.GLenum(target), C.GLintptr(offset), C.GLsizeiptr(size), unsafe.Pointer(data)) }
// Returns a subset of a buffer object's data store func GetBufferSubData(target GLenum, offset int, size int, data interface{}) { C.glGetBufferSubData(C.GLenum(target), C.GLintptr(offset), C.GLsizeiptr(size), ptr(data)) }
// Bind this buffer range as index of target func (buffer Buffer) BindBufferRange(target GLenum, index uint, offset int, size uint) { C.glBindBufferRange(C.GLenum(target), C.GLuint(index), C.GLuint(buffer), C.GLintptr(offset), C.GLsizeiptr(size)) }
func BufferSubData(target Enum, offset int, data []byte) { C.glBufferSubData(target.c(), C.GLintptr(offset), C.GLsizeiptr(len(data)), unsafe.Pointer(&data[0])) }
// BufferSubData updates a subset of a buffer object's data store. func BufferSubData(targ BufferTarget, offs int, data interface{}) { _, sz, ptr := rawData(data) C.glBufferSubData(C.GLenum(targ), C.GLintptr(offs), C.GLsizeiptr(sz), ptr) }