Add more new functions

This commit is contained in:
JupiterRider 2023-05-11 16:36:48 +02:00
parent 3fb1258932
commit bb7c8b3f3b
6 changed files with 118 additions and 0 deletions

View file

@ -72,6 +72,14 @@ func LoadWaveFromMemory(fileType string, fileData []byte, dataSize int32) Wave {
return v
}
// IsWaveReady - Checks if wave data is ready
func IsWaveReady(wave Wave) bool {
cwave := wave.cptr()
ret := C.IsWaveReady(*cwave)
v := bool(ret)
return v
}
// LoadSound - Load sound to memory
func LoadSound(fileName string) Sound {
cfileName := C.CString(fileName)
@ -89,6 +97,14 @@ func LoadSoundFromWave(wave Wave) Sound {
return v
}
// IsSoundReady - Checks if a sound is ready
func IsSoundReady(sound Sound) bool {
csound := sound.cptr()
ret := C.IsSoundReady(*csound)
v := bool(ret)
return v
}
// UpdateSound - Update sound buffer with new data
func UpdateSound(sound Sound, data []byte, samplesCount int32) {
csound := sound.cptr()
@ -234,6 +250,14 @@ func LoadMusicStreamFromMemory(fileType string, fileData []byte, dataSize int32)
return v
}
// IsMusicReady - Checks if a music stream is ready
func IsMusicReady(music Music) bool {
cmusic := *(*C.Music)(unsafe.Pointer(&music))
ret := C.IsMusicReady(cmusic)
v := bool(ret)
return v
}
// UnloadMusicStream - Unload music stream
func UnloadMusicStream(music Music) {
cmusic := *(*C.Music)(unsafe.Pointer(&music))
@ -332,6 +356,14 @@ func LoadAudioStream(sampleRate uint32, sampleSize uint32, channels uint32) Audi
return v
}
// IsAudioStreamReady - Checks if an audio stream is ready
func IsAudioStreamReady(stream AudioStream) bool {
cstream := stream.cptr()
ret := C.IsAudioStreamReady(*cstream)
v := bool(ret)
return v
}
// UnloadAudioStream - Unload audio stream and free memory
func UnloadAudioStream(stream AudioStream) {
cstream := stream.cptr()