mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-17 08:20:30 +02:00
Prepare for interchangable Windows audio backends
This commit is contained in:
1 parent
26e4cb4a21
commit
c8dfcd5e74
5 files changed
+140
-142
No files matched your search
+9
-3
@@ -142,6 +142,10 @@ static std::vector<PendingMessage> pendingMessages;
|
||||
static Thin3DContext *thin3d;
|
||||
static UIContext *uiContext;
|
||||
|
||||
#ifdef _WIN32
|
||||
WindowsAudioBackend *winAudioBackend;
|
||||
#endif
|
||||
|
||||
Thin3DContext *GetThin3D() {
|
||||
return thin3d;
|
||||
}
|
||||
@@ -235,7 +239,7 @@ int NativeMix(short *audio, int num_samples) {
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
DSound_UpdateSound();
|
||||
winAudioBackend->Update();
|
||||
#endif
|
||||
|
||||
return num_samples;
|
||||
@@ -571,13 +575,15 @@ void NativeInitGraphics() {
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
|
||||
#ifdef _WIN32
|
||||
DSound_StartSound(MainWindow::GetHWND(), &Win32Mix, 44100);
|
||||
winAudioBackend = CreateAudioBackend(AUDIO_BACKEND_AUTO);
|
||||
winAudioBackend->Init(MainWindow::GetHWND(), &Win32Mix, 44100);
|
||||
#endif
|
||||
}
|
||||
|
||||
void NativeShutdownGraphics() {
|
||||
#ifdef _WIN32
|
||||
DSound_StopSound();
|
||||
delete winAudioBackend;
|
||||
winAudioBackend = NULL;
|
||||
#endif
|
||||
|
||||
screenManager->deviceLost();
|
||||
|
||||
Reference in new issue
Block a user