diff options
| author | realtradam <[email protected]> | 2023-06-16 02:17:51 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2023-06-16 02:17:51 -0400 |
| commit | 4cb44499b27cd8fe4955a16a9af46cf97ecf06e3 (patch) | |
| tree | 51cbcfb7a5328dc3fbc9dbc5a502ed70ed7c951d /src/audio/rodeo_audio.c | |
| parent | a47cc44ef7191d03f8ca1b8d4e6b9dd34fba1807 (diff) | |
| download | RodeoKit-4cb44499b27cd8fe4955a16a9af46cf97ecf06e3.tar.gz RodeoKit-4cb44499b27cd8fe4955a16a9af46cf97ecf06e3.zip | |
switch SDL_Init to use SDL_InitSubSystem and move to where relevant
Diffstat (limited to 'src/audio/rodeo_audio.c')
| -rw-r--r-- | src/audio/rodeo_audio.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/src/audio/rodeo_audio.c b/src/audio/rodeo_audio.c index 485ddfd..78cef3d 100644 --- a/src/audio/rodeo_audio.c +++ b/src/audio/rodeo_audio.c @@ -19,17 +19,42 @@ void rodeo_audio_init(uint32_t channels) { - if(Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 2048) < 0) + rodeo_log( + rodeo_logLevel_info, + "Initializing SDL Audio..." + ); + if(SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) { rodeo_log( rodeo_logLevel_error, "Failed to initialize SDL Audio. SDL_Error: %s", SDL_GetError() ); + exit(EXIT_FAILURE); + } + rodeo_log( + rodeo_logLevel_info, + "Success initializing SDL Audio" + ); + rodeo_log( + rodeo_logLevel_info, + "Initializing SDL Mixer..." + ); + if(Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 2048) < 0) + { + rodeo_log( + rodeo_logLevel_error, + "Failed to initialize SDL Mixer. SDL_Error: %s", + SDL_GetError() + ); } else { - Mix_AllocateChannels((int32_t)channels); + rodeo_log( + rodeo_logLevel_info, + "Success initializing SDL Mixer" + ); + Mix_AllocateChannels((int32_t)channels); /* irodeo_audio_channelPool_num = 1; //num_sound_pools; irodeo_audio_channelPool_size = channels; //size_sound_pools; |
