func CreateContext(dev Device, sync bool, frequency, refresh int) (Context, error) { var syncval int if sync { syncval = 1 } else { syncval = 0 } args := [...]C.ALCint{C.ALC_SYNC, (C.ALCint)(syncval), C.ALC_FREQUENCY, (C.ALCint)(frequency), C.ALC_REFRESH, (C.ALCint)(refresh), C.ALC_INVALID} return Context{C.alcCreateContext(dev.device, (*C.ALCint)(&args[0]))}, GetError() }
// CreateContext creates a new context. func (d *Device) CreateContext(attrs []int32) *Context { // TODO(jbd): Handle attributes. c := C.alcCreateContext(d.d, nil) return &Context{c: c} }
func CreateContext(device *Device, attrlist []int32) (context *Context) { return (*Context)(C.alcCreateContext( (*C.ALCcontext)(context), (*C.ALCint)(&attrlist[0]), )) }
func alcCreateContext(d unsafe.Pointer, attrs []int32) unsafe.Pointer { dev := (*C.ALCdevice)(d) return (unsafe.Pointer)(C.alcCreateContext(dev, nil)) }
func (self *Device) CreateContext() *Context { // TODO: really a method? // TODO: attrlist support return &Context{C.alcCreateContext(self.handle, nil)} }
func CreateDefaultContext(dev Device) (Context, error) { return Context{C.alcCreateContext(dev.device, nil)}, GetError() }