mix init check

This commit is contained in:
Mylloon 2023-05-03 20:11:18 +02:00
parent bfebb9b969
commit 77b584d89f
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -19,7 +19,11 @@ void callback(void *_, Uint8 *stream, int size) {
}
void initMusic(Mix_Chunk *music, const char *filename) {
Mix_Init(MIX_INIT_MID);
if (!Mix_Init(MIX_INIT_MID)) {
fprintf(stderr, "Erreur Mix_Init\n");
exit(2);
}
if (Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 1, 2048)) {
fprintf(stderr, "Erreur Mix_OpenAudio\n");
exit(2);