Beispiel #1
0
func GenBuffer() (r0 Buffer) {
	defer func() {
		errstr := errDrain()
		log.Printf("gl.GenBuffer() %v%v", r0, errstr)
	}()
	var b Buffer
	C.glGenBuffers(1, (*C.GLuint)(&b.Value))
	return b
}
Beispiel #2
0
Datei: gl.go Projekt: extrame/gl
// NewBuffer creates a new buffer using glGenBuffers. If targ is not 0, it will call Buffer.Set with the given parameters.
func NewBuffer(targ int, data interface{}, usage int) *Buffer {
	var buf C.GLuint

	C.glGenBuffers(1, &buf)
	buff := &Buffer{}
	buff.i = buf
	if targ != 0 {
		buff.Set(targ, data, usage)
	}
	return buff
}
Beispiel #3
0
func CreateBuffer() Buffer {
	var b Buffer
	C.glGenBuffers(1, (*C.GLuint)(&b.Value))
	return b
}
Beispiel #4
0
func GenBuffers(
	n Sizei, buffers *uint32) {
	C.glGenBuffers(
		C.GLsizei(n),
		(*C.GLuint)(buffers))
}
Beispiel #5
0
func GenBuffer() C.GLuint {
	var buf C.GLuint
	C.glGenBuffers(1, &buf)
	return C.GLuint(buf)
}
Beispiel #6
0
func CreateBuffer() Buffer {
	buffer := Buffer(0)
	C.glGenBuffers(C.GLsizei(1), (*C.GLuint)(&buffer))
	return buffer
}
Beispiel #7
0
func GenBuffers(buffers []Buffer) {
	C.glGenBuffers(C.GLsizei(len(buffers)), (*C.GLuint)(&buffers[0]))
}
Beispiel #8
0
func GenBuffers(n int, buffers Void) {
	C.glGenBuffers(C.GLsizei(n), (*C.GLuint)(unsafe.Pointer(buffers)))
}
Beispiel #9
0
func GenBuffers(n Sizei, buffers []Uint) {
	if Sizei(len(buffers)) < n {
		panic(fmt.Sprintf("trying to use %d elements in a buffer of length %d", n, len(buffers)))
	}
	C.glGenBuffers(C.GLsizei(n), (*C.GLuint)(unsafe.Pointer(&buffers[0])))
}
Beispiel #10
0
// Create single buffer object
func GenBuffer() Buffer {
	var b C.GLuint
	C.glGenBuffers(1, &b)
	return Buffer(b)
}
Beispiel #11
0
// GenBuffers generates and returns n named buffer objects.
func GenBuffers(n int) []Buffer {
	bufs := make([]Buffer, n)
	C.glGenBuffers(C.GLsizei(n), (*C.GLuint)(&bufs[0]))
	return bufs
}