示例#1
0
文件: alc.go 项目: 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)))}
}
示例#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))))
}
示例#3
0
文件: alc.go 项目: nzlov/goal
func OpenDevice(name string) *Device {
	var s *C.ALCchar
	s = alcString(name)
	defer freeString(s)
	return (*Device)(C.alcOpenDevice(s))
}
示例#4
0
func OpenDevice(deviceName string) (Device, error) {
	return Device{C.alcOpenDevice((*C.ALCchar)(C.CString(deviceName)))}, GetError()
}