예제 #1
0
파일: gldebug.go 프로젝트: Miaque/mojo
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]))
}
예제 #2
0
파일: gla.go 프로젝트: 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
}
예제 #3
0
파일: gles2.go 프로젝트: remogatto/egles
func BufferSubData(
	target Enum, offset IntPtr,
	size SizeiPtr, data Void) {
	C.glBufferSubData(
		C.GLenum(target),
		C.GLintptr(offset),
		C.GLsizeiptr(size),
		unsafe.Pointer(data))

}
예제 #4
0
파일: gl_opengles.go 프로젝트: tanema/amore
func BufferSubData(target Enum, offset, size int, data unsafe.Pointer) {
	C.glBufferSubData(target.c(), C.GLintptr(offset), C.GLsizeiptr(size), data)
}
예제 #5
0
파일: buffer.go 프로젝트: jackscan/go-gles3
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]))
}
예제 #6
0
파일: buffer.go 프로젝트: jackscan/go-gles3
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))
}
예제 #7
0
파일: es2.go 프로젝트: nick-fedesna/egles
func BufferSubData(target uint, offset int, size int, data Void) {
	C.glBufferSubData(
		C.GLenum(target), C.GLintptr(offset),
		C.GLsizeiptr(size), unsafe.Pointer(data))
}
예제 #8
0
// 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))
}
예제 #9
0
// 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))
}
예제 #10
0
파일: gl_opengles.go 프로젝트: shibukawa/gl
func BufferSubData(target Enum, offset int, data []byte) {
	C.glBufferSubData(target.c(), C.GLintptr(offset), C.GLsizeiptr(len(data)), unsafe.Pointer(&data[0]))
}
예제 #11
0
파일: bufobjs.go 프로젝트: eaburns/gl
// 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)
}