src/audio/xaudio2/SDL_xaudio2.c
changeset 5635 bef0f093c9da
parent 5634 093e60544778
child 5636 44bfdab5eaf1
     1.1 --- a/src/audio/xaudio2/SDL_xaudio2.c	Mon Aug 22 14:30:49 2011 -0400
     1.2 +++ b/src/audio/xaudio2/SDL_xaudio2.c	Mon Aug 22 14:37:45 2011 -0400
     1.3 @@ -24,11 +24,35 @@
     1.4  #include "../SDL_audio_c.h"
     1.5  #include "SDL_assert.h"
     1.6  
     1.7 -#define INITGUID 1
     1.8 -#include "SDL_xaudio2.h"
     1.9 +#include "../SDL_sysaudio.h"
    1.10 +
    1.11 +#if SDL_AUDIO_DRIVER_XAUDIO2
    1.12 +#include <dxsdkver.h> /* XAudio2 exists as of the March 2008 DirectX SDK */
    1.13 +#if (defined(_DXSDK_BUILD_MAJOR) && (_DXSDK_BUILD_MAJOR >= 1284))
    1.14 +#   define SDL_HAVE_XAUDIO2_H 1
    1.15 +#endif
    1.16 +#endif
    1.17  
    1.18  #ifdef SDL_HAVE_XAUDIO2_H
    1.19  
    1.20 +#define INITGUID 1
    1.21 +#include <XAudio2.h>
    1.22 +
    1.23 +/* Hidden "this" pointer for the audio functions */
    1.24 +#define _THIS	SDL_AudioDevice *this
    1.25 +
    1.26 +struct SDL_PrivateAudioData
    1.27 +{
    1.28 +    IXAudio2 *ixa2;
    1.29 +    IXAudio2SourceVoice *source;
    1.30 +    IXAudio2MasteringVoice *mastering;
    1.31 +    HANDLE semaphore;
    1.32 +    Uint8 *mixbuf;
    1.33 +    int mixlen;
    1.34 +    Uint8 *nextbuf;
    1.35 +};
    1.36 +
    1.37 +
    1.38  static __inline__ char *
    1.39  utf16_to_utf8(const WCHAR *S)
    1.40  {