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 }
// 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 }
func CreateBuffer() Buffer { var b Buffer C.glGenBuffers(1, (*C.GLuint)(&b.Value)) return b }
func GenBuffers( n Sizei, buffers *uint32) { C.glGenBuffers( C.GLsizei(n), (*C.GLuint)(buffers)) }
func GenBuffer() C.GLuint { var buf C.GLuint C.glGenBuffers(1, &buf) return C.GLuint(buf) }
func CreateBuffer() Buffer { buffer := Buffer(0) C.glGenBuffers(C.GLsizei(1), (*C.GLuint)(&buffer)) return buffer }
func GenBuffers(buffers []Buffer) { C.glGenBuffers(C.GLsizei(len(buffers)), (*C.GLuint)(&buffers[0])) }
func GenBuffers(n int, buffers Void) { C.glGenBuffers(C.GLsizei(n), (*C.GLuint)(unsafe.Pointer(buffers))) }
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]))) }
// Create single buffer object func GenBuffer() Buffer { var b C.GLuint C.glGenBuffers(1, &b) return Buffer(b) }
// 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 }