Remove SDL_Mixer in favor of core SDL audio device

This commit is contained in:
scawful
2024-04-23 11:27:03 -04:00
parent 136cd2e2d9
commit 528d8fd9a6
6 changed files with 1 additions and 27 deletions

View File

@@ -1,7 +1,6 @@
#include "controller.h"
#include <SDL.h>
#include <SDL_mixer.h>
#include <imgui/backends/imgui_impl_sdl2.h>
#include <imgui/backends/imgui_impl_sdlrenderer2.h>
#include <imgui/imgui.h>
@@ -188,7 +187,6 @@ void Controller::DoRender() const {
void Controller::OnExit() {
master_editor_.Shutdown();
Mix_CloseAudio();
SDL_PauseAudioDevice(audio_device_, 1);
SDL_CloseAudioDevice(audio_device_);
delete audio_buffer_;
@@ -220,11 +218,6 @@ absl::Status Controller::CreateSDL_Window() {
return absl::InternalError(
absl::StrFormat("SDL_CreateWindow: %s\n", SDL_GetError()));
}
// Initialize SDL_mixer
if (Mix_OpenAudio(32000, MIX_DEFAULT_FORMAT, 2, 1024) < 0) {
printf("SDL_mixer could not initialize! SDL_mixer Error: %s\n",
Mix_GetError());
}
}
return absl::OkStatus();
}