add SDL_mixer

This commit is contained in:
scawful
2023-01-01 17:48:51 -06:00
parent 2d3937e791
commit b0338f588a
7 changed files with 62 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
#include "controller.h"
#include <SDL.h>
#include <SDL_mixer.h>
#include <imgui/backends/imgui_impl_sdl.h>
#include <imgui/backends/imgui_impl_sdlrenderer.h>
#include <imgui/imgui.h>
@@ -165,6 +166,11 @@ absl::Status Controller::CreateWindow() {
return absl::InternalError(
absl::StrFormat("SDL_CreateWindow: %s\n", SDL_GetError()));
}
// Initialize SDL_mixer
if (Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 2048) < 0) {
printf("SDL_mixer could not initialize! SDL_mixer Error: %s\n",
Mix_GetError());
}
}
return absl::OkStatus();
}