Beispiel #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
}
Beispiel #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)
}
Beispiel #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}
}
Beispiel #4
0
func LoadMUS(file string) *Music {
	_file := (C.CString)(file)
	return (*Music)(unsafe.Pointer(C.Mix_LoadMUS(_file)))
}
Beispiel #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)))
}
Beispiel #6
0
func LoadMUS(res string) (* C.Mix_Music) {
  cres := cstr(res) ; defer cres.free()   
  return C.Mix_LoadMUS(cres)
}