示例#1
0
func LoadMUS(file string) (mus *Music, err error) {
	_file := C.CString(file)
	defer C.free(unsafe.Pointer(_file))
	mus = (*Music)(unsafe.Pointer(C.Mix_LoadMUS(_file)))
	if mus == nil {
		err = sdl.GetError()
	}
	return
}
示例#2
0
func loadMusic(name string) *Music {
	cname := C.CString(name)
	music := C.Mix_LoadMUS(cname)
	C.free(unsafe.Pointer(cname))
	if music == nil {
		panic(fmt.Sprintf("Unable to load Music file (%v): %v", name, util.GetMixError()))
	}
	return New(name, music)
}
示例#3
0
// Loads a music file to use.
func LoadMUS(file string) *Music {
	cfile := C.CString(file)
	cmusic := C.Mix_LoadMUS(cfile)
	C.free(unsafe.Pointer(cfile))

	if cmusic == nil {
		return nil
	}

	return &Music{cmusic}
}
示例#4
0
func LoadMUS(file string) *Music {
	_file := (C.CString)(file)
	return (*Music)(unsafe.Pointer(C.Mix_LoadMUS(_file)))
}
示例#5
0
func LoadMUS(file string) *Music {
	_file := C.CString(file)
	defer C.free(unsafe.Pointer(_file))
	return (*Music)(unsafe.Pointer(C.Mix_LoadMUS(_file)))
}
示例#6
0
文件: mixer.go 项目: beoran/fungo
func LoadMUS(res string) (* C.Mix_Music) {
  cres := cstr(res) ; defer cres.free()   
  return C.Mix_LoadMUS(cres)
}