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