From ce1ed201e661695e6abade3d9fb0fb3e16c32e4e Mon Sep 17 00:00:00 2001 From: Ian Karlsson Date: Thu, 8 Apr 2021 12:29:48 +0200 Subject: [PATCH] Fix DSound initialization --- src/audio_manager.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/audio_manager.cpp b/src/audio_manager.cpp index c54f679..ac2d36c 100644 --- a/src/audio_manager.cpp +++ b/src/audio_manager.cpp @@ -78,6 +78,8 @@ void Audio_Manager::set_window_handle(void* new_handle) waiting_for_handle = false; if(open_driver()) set_audio_enabled(false); + else + set_audio_enabled(true); } if(driver_opened && !device_opened) { @@ -224,6 +226,15 @@ int Audio_Manager::open_driver() return -1; } +#ifdef AUDDRV_DSOUND + if(info->drvSig == ADRVSIG_DSOUND && window_handle) + { + void* dsoundDrv; + dsoundDrv = AudioDrv_GetDrvData(driver_handle); + DSound_SetHWnd(dsoundDrv, (HWND)window_handle); + } +#endif + #ifdef AUDDRV_PULSE if(info->drvSig == ADRVSIG_PULSE) {