fix SDL sound on windows

In SoundSDL, when building on windows add this init code:

```
SDL_setenv("SDL_AUDIODRIVER", "directsound", true);
```

Otherwise there is no sound on windows.

Also update SDL to 2.0.8 from 2.0.7 in build scripts.
This commit is contained in:
Rafael Kitover 2018-04-16 13:10:12 -04:00
parent fe9f06414d
commit d5f90f0a05
2 changed files with 6 additions and 1 deletions

View File

@ -115,6 +115,11 @@ void SoundSDL::write(uint16_t * finalWave, int length) {
bool SoundSDL::init(long sampleRate) {
if (initialized) deinit();
// no sound on windows unless we do this
#ifdef _WIN32
SDL_setenv("SDL_AUDIODRIVER", "directsound", true);
#endif
SDL_AudioSpec audio;
SDL_memset(&audio, 0, sizeof(audio));

View File

@ -165,7 +165,7 @@ DISTS=$DISTS'
libgpg-error https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.27.tar.bz2 lib/libgpg-error.a
libgcrypt https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.8.2.tar.bz2 lib/libgcrypt.a
libsecret http://ftp.gnome.org/pub/gnome/sources/libsecret/0.18/libsecret-0.18.5.tar.xz lib/libsecret-1.a
sdl2 https://www.libsdl.org/release/SDL2-2.0.7.tar.gz lib/libSDL2.a
sdl2 https://www.libsdl.org/release/SDL2-2.0.8.tar.gz lib/libSDL2.a
flac https://github.com/xiph/flac/archive/f7cd466c24fb5d1966943f3ea36a1f4a37858597.tar.gz lib/libFLAC.a
libogg http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.xz lib/libogg.a
libvorbis https://github.com/xiph/vorbis/archive/v1.3.5.tar.gz lib/libvorbis.a