Skip to content

Commit

Permalink
wasapi: Initial WASAPI support, for Windows Vista and later.
Browse files Browse the repository at this point in the history
This should remain binary compatible with Windows XP, as we dynamically
load anything we need and fall back to DirectSound/WinMM/XAudio2 if not
available.
  • Loading branch information
icculus committed Feb 14, 2017
1 parent c93bca4 commit 6046fd4
Show file tree
Hide file tree
Showing 7 changed files with 860 additions and 0 deletions.
2 changes: 2 additions & 0 deletions VisualC/SDL/SDL.vcxproj
Expand Up @@ -361,6 +361,7 @@
<ClInclude Include="..\..\src\video\windows\SDL_windowsshape.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsvideo.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowswindow.h" />
<ClInclude Include="..\..\src\audio\wasapi\SDL_wasapi.h" />
<ClInclude Include="..\..\src\audio\winmm\SDL_winmm.h" />
<ClInclude Include="..\..\src\core\windows\SDL_xinput.h" />
<ClInclude Include="..\..\src\haptic\windows\SDL_xinputhaptic_c.h" />
Expand Down Expand Up @@ -491,6 +492,7 @@
<ClCompile Include="..\..\src\video\windows\SDL_windowsshape.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsvideo.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowswindow.c" />
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
<ClCompile Include="..\..\src\audio\winmm\SDL_winmm.c" />
<ClCompile Include="..\..\src\audio\xaudio2\SDL_xaudio2.c" />
<ClCompile Include="..\..\src\core\windows\SDL_xinput.c" />
Expand Down
8 changes: 8 additions & 0 deletions VisualC/SDL/SDL_VS2008.vcproj
Expand Up @@ -1437,6 +1437,14 @@
RelativePath="..\..\src\video\windows\SDL_windowswindow.h"
>
</File>
<File
RelativePath="..\..\src\audio\wasapi\SDL_wasapi.c"
>
</File>
<File
RelativePath="..\..\src\audio\wasapi\SDL_wasapi.h"
>
</File>
<File
RelativePath="..\..\src\audio\winmm\SDL_winmm.c"
>
Expand Down
1 change: 1 addition & 0 deletions include/SDL_config_windows.h
Expand Up @@ -154,6 +154,7 @@ typedef unsigned int uintptr_t;
#endif

/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_WASAPI 1
#define SDL_AUDIO_DRIVER_DSOUND 1
#define SDL_AUDIO_DRIVER_XAUDIO2 1
#define SDL_AUDIO_DRIVER_WINMM 1
Expand Down
3 changes: 3 additions & 0 deletions src/audio/SDL_audio.c
Expand Up @@ -68,6 +68,9 @@ static const AudioBootStrap *const bootstrap[] = {
#if SDL_AUDIO_DRIVER_NAS
&NAS_bootstrap,
#endif
#if SDL_AUDIO_DRIVER_WASAPI
&WASAPI_bootstrap,
#endif
#if SDL_AUDIO_DRIVER_XAUDIO2
&XAUDIO2_bootstrap,
#endif
Expand Down

0 comments on commit 6046fd4

Please sign in to comment.