Пример #1
0
func GenBuffers(n int) (buffers []*Buffer) {
	bufferIds := make([]C.ALuint, n)
	C.walGenBuffers(C.ALsizei(n), unsafe.Pointer(&bufferIds[0]))

	if GetError() != AlNoError {
		return
	}

	buffers = make([]*Buffer, n)
	for i, v := range bufferIds {
		b := new(Buffer)
		b.handle = v
		rememberBuffer(b)
		buffers[i] = b
	}
	return
}
Пример #2
0
// NewBuffers() creates n fresh buffers.
// Renamed, was GenBuffers.
func NewBuffers(n int) (buffers []Buffer) {
	buffers = make([]Buffer, n)
	C.walGenBuffers(C.ALsizei(n), unsafe.Pointer(&buffers[0]))
	return
}