Skip to content

Commit

Permalink
Fix DSound initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
superctr committed Apr 8, 2021
1 parent e5879f7 commit ce1ed20
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/audio_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit ce1ed20

Please sign in to comment.