Ejemplo n.º 1
0
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]))
}
Ejemplo n.º 2
0
Archivo: gla.go Proyecto: spate/gla
// 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
}
Ejemplo n.º 3
0
func BufferSubData(
	target Enum, offset IntPtr,
	size SizeiPtr, data Void) {
	C.glBufferSubData(
		C.GLenum(target),
		C.GLintptr(offset),
		C.GLsizeiptr(size),
		unsafe.Pointer(data))

}
Ejemplo n.º 4
0
func BufferSubData(target Enum, offset, size int, data unsafe.Pointer) {
	C.glBufferSubData(target.c(), C.GLintptr(offset), C.GLsizeiptr(size), data)
}
Ejemplo n.º 5
0
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]))
}
Ejemplo n.º 6
0
func BufferSubData(target uint, offset int, size int, data Void) {
	C.glBufferSubData(
		C.GLenum(target), C.GLintptr(offset),
		C.GLsizeiptr(size), unsafe.Pointer(data))
}
Ejemplo n.º 7
0
//  Update a subset of a buffer object's data store
func BufferSubData(target GLenum, offset int, size int, data interface{}) {
	C.glBufferSubData(C.GLenum(target), C.GLintptr(offset), C.GLsizeiptr(size),
		ptr(data))
}
Ejemplo n.º 8
0
func BufferSubData(target Enum, offset int, data []byte) {
	C.glBufferSubData(target.c(), C.GLintptr(offset), C.GLsizeiptr(len(data)), unsafe.Pointer(&data[0]))
}
Ejemplo n.º 9
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)
}