Пример #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()
}