Beispiel #1
0
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()
}
Beispiel #2
0
// 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}
}
Beispiel #3
0
Datei: alc.go Projekt: nzlov/goal
func CreateContext(device *Device, attrlist []int32) (context *Context) {
	return (*Context)(C.alcCreateContext(
		(*C.ALCcontext)(context),
		(*C.ALCint)(&attrlist[0]),
	))
}
Beispiel #4
0
func alcCreateContext(d unsafe.Pointer, attrs []int32) unsafe.Pointer {
	dev := (*C.ALCdevice)(d)
	return (unsafe.Pointer)(C.alcCreateContext(dev, nil))
}
Beispiel #5
0
func (self *Device) CreateContext() *Context {
	// TODO: really a method?
	// TODO: attrlist support
	return &Context{C.alcCreateContext(self.handle, nil)}
}
Beispiel #6
0
func CreateDefaultContext(dev Device) (Context, error) {
	return Context{C.alcCreateContext(dev.device, nil)}, GetError()

}