feat: add audio system

This commit is contained in:
2026-10-23 22:07:52 +02:00
parent a3d3da4a67
commit 0b7cc38543
28 changed files with 7412 additions and 214 deletions
+6
View File
@@ -10,6 +10,7 @@
#include <tracy/Tracy.hpp>
#include <common/TracySystem.hpp>
#include <destrum/Audio/AudioSystem.h>
#include <destrum/FS/AssetFS.h>
#include <destrum/Graphics/Resources/FontCache.h>
#include <destrum/Scene/ResourceCollector.h>
@@ -73,6 +74,7 @@ void App::init(const AppParams& params)
renderer.init(gfxDevice, resources, params.renderSize);
InputManager::GetInstance().Init();
AudioSystem::GetInstance().Init();
Time::GetInstance().Update();
customInitStarted = true;
@@ -134,6 +136,7 @@ void App::resizeRenderTarget(const glm::ivec2& size)
void App::collectUnusedResources()
{
CollectUnusedResources(SceneManager::GetInstance(), resources, gfxDevice);
AudioSystem::GetInstance().ReleaseUnusedClips();
}
void App::run()
@@ -196,6 +199,8 @@ void App::run()
runFixedSteps();
AudioSystem::GetInstance().Update(dt, isPlaying() && (isPaused() || simulation.paused), &getViewCamera());
bool skipFrame = false;
handleSwapchainResize(skipFrame);
if (skipFrame) {
@@ -392,6 +397,7 @@ void App::cleanup()
attempt([this] { customCleanup(); });
}
attempt([] { SceneManager::GetInstance().Destroy(); });
attempt([] { AudioSystem::GetInstance().Shutdown(); });
attempt([] { FontCache::GetInstance().Clear(); });
attempt([this] { renderer.cleanup(gfxDevice); });
attempt([this] { imguiPass.cleanup(); });