Example #1
0
File: alc.go Project: Miaque/mojo
// Open opens a new device in the OpenAL layer.
func Open(name string) *Device {
	n := C.CString(name)
	defer C.free(unsafe.Pointer(n))
	return &Device{d: C.alcOpenDevice((*C.ALCchar)(unsafe.Pointer(n)))}
}
Example #2
0
func alcOpenDevice(name string) unsafe.Pointer {
	n := C.CString(name)
	defer C.free(unsafe.Pointer(n))

	return (unsafe.Pointer)(C.alcOpenDevice((*C.ALCchar)(unsafe.Pointer(n))))
}
Example #3
0
File: alc.go Project: nzlov/goal
func OpenDevice(name string) *Device {
	var s *C.ALCchar
	s = alcString(name)
	defer freeString(s)
	return (*Device)(C.alcOpenDevice(s))
}
Example #4
0
func OpenDevice(deviceName string) (Device, error) {
	return Device{C.alcOpenDevice((*C.ALCchar)(C.CString(deviceName)))}, GetError()
}