Initial changes for Raylib 5.0 and some missing functions.
This commit is contained in:
76
src/audio.c
76
src/audio.c
@@ -7,6 +7,41 @@
|
||||
## Audio - Audio device management functions
|
||||
*/
|
||||
|
||||
/*
|
||||
> RL.InitAudioDevice()
|
||||
|
||||
Initialize audio device and context
|
||||
*/
|
||||
int laudioInitAudioDevice( lua_State *L ) {
|
||||
InitAudioDevice();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
> RL.CloseAudioDevice()
|
||||
|
||||
Close the audio device and context
|
||||
*/
|
||||
int laudioCloseAudioDevice( lua_State *L ) {
|
||||
CloseAudioDevice();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
> isReady = RL.IsAudioDeviceReady()
|
||||
|
||||
Check if audio device has been initialized successfully
|
||||
|
||||
- Success return bool
|
||||
*/
|
||||
int laudioIsAudioDeviceReady( lua_State *L ) {
|
||||
lua_pushboolean( L, IsAudioDeviceReady() );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
> RL.SetMasterVolume( float volume )
|
||||
|
||||
@@ -20,6 +55,19 @@ int laudioSetMasterVolume( lua_State *L ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
> isReady = RL.GetMasterVolume()
|
||||
|
||||
Get master volume (listener)
|
||||
|
||||
- Success return float
|
||||
*/
|
||||
int laudioGetMasterVolume( lua_State *L ) {
|
||||
lua_pushnumber( L, GetMasterVolume() );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
## Audio - Wave/Sound loading/unloading functions
|
||||
*/
|
||||
@@ -94,6 +142,21 @@ int laudioLoadSoundFromWave( lua_State *L ) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
> sound = RL.LoadSoundAlias( Sound source )
|
||||
|
||||
Create a new sound that shares the same sample data as the source sound, does not own the sound data
|
||||
|
||||
- Success return Sound
|
||||
*/
|
||||
int laudioLoadSoundAlias( lua_State *L ) {
|
||||
Sound *source = uluaGetSound( L, 1 );
|
||||
|
||||
uluaPushSound( L, LoadSoundAlias( *source ) );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
> isReady = RL.IsSoundReady( Sound sound )
|
||||
|
||||
@@ -135,6 +198,19 @@ int laudioUnloadSound( lua_State *L ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
> RL.UnloadSoundAlias( Sound alias )
|
||||
|
||||
Unload a sound alias (does not deallocate sample data)
|
||||
*/
|
||||
int laudioUnloadSoundAlias( lua_State *L ) {
|
||||
Sound *alias = uluaGetSound( L, 1 );
|
||||
|
||||
UnloadSoundAlias( *alias );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
> success = RL.ExportWave( Wave wave, string fileName )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user