Audio fix
This commit is contained in:
@@ -15,7 +15,7 @@ namespace Game::Audio {
|
||||
SDL_AudioDeviceID getAudioDevice() const { return mDevice; }
|
||||
|
||||
private:
|
||||
SDL_AudioSpec mAudioSpec;
|
||||
SDL_AudioDeviceID mDevice;
|
||||
SDL_AudioSpec mAudioSpec{};
|
||||
SDL_AudioDeviceID mDevice = 0;
|
||||
};
|
||||
};
|
||||
@@ -32,6 +32,7 @@ namespace Game::Object {
|
||||
Uint8* mAudioBuffer = nullptr;
|
||||
Uint32 mAudioLength = 0;
|
||||
SDL_AudioStream* mAudioStream = nullptr;
|
||||
SDL_AudioSpec mSourceSpec{};
|
||||
int mVolume;
|
||||
};
|
||||
}
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <state/gamestate.hpp>
|
||||
#include <game/gamemanager.hpp>
|
||||
#include <audio/audio.hpp>
|
||||
#include <chrono>
|
||||
|
||||
namespace Game::Window {
|
||||
class Window {
|
||||
@@ -24,14 +25,19 @@ namespace Game::Window {
|
||||
void setTargetFPS(int fps) { mTargetFPS = fps; }
|
||||
int getTargetFPS() { return mTargetFPS; }
|
||||
|
||||
static SDL_Window* getSDLWindowBackend() { return sWindowBackend; }
|
||||
|
||||
Renderer::Renderer* getRenderer() { return &mRenderer; }
|
||||
|
||||
private:
|
||||
static inline SDL_Window* sWindowBackend = nullptr;
|
||||
SDL_Window* mWindow;
|
||||
Renderer::Renderer mRenderer;
|
||||
Game::GameManager mGameManager;
|
||||
std::jthread mGameThread;
|
||||
bool mRunning;
|
||||
int mTargetFPS = 60;
|
||||
size_t mFrameCount = 0;
|
||||
std::chrono::steady_clock::time_point mLastFPSTime;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user