func RWFromConstMem(data []byte) (*RWops, error) { rw := C.SDL_RWFromConstMem(unsafe.Pointer(&data[0]), C.int(len(data))) if rw == nil { return nil, getError() } return &RWops{rw}, nil }
func loadSoundFromData(data []Double, sps int) *C.Mix_Chunk { bytes := util.CreateWavBytes(data, sps) rwop := C.SDL_RWFromConstMem(unsafe.Pointer(&bytes[0]), C.int(len(bytes))) chunk := C.Mix_LoadWAV_RW(rwop, 1) if chunk == nil { panic(fmt.Sprintf("Unable to load Sound data: %v", util.GetMixError())) } return chunk }
func RWFromConstMem(m []byte) *RWops { return (*RWops)(C.SDL_RWFromConstMem(unsafe.Pointer(&m[0]), C.int(len(m)))) }