UCyborg / BerserkerQuake2

Berserker@Quake2 game engine, ported to SDL2 library.
GNU General Public License v2.0
20 stars 9 forks source link

Update SDL to 2.0.6 #9

Open ROCKNROLLKID opened 7 years ago

ROCKNROLLKID commented 7 years ago

SDL 2.0.6 has been released, which includes full Vulkan support, as well as many bug fixes and some optimizations. There are no builds, yet, but the source code is at 2.0.6 now.

UCyborg commented 7 years ago

It seems newer SDL versions favor WASAPI as the default sound backend on Windows, resulting in sound initialization failure. If they're not planning to drop DirectSound support as well, adding a console variable to set sound backend and defaulting to DirectSound might restore the sound without having to manually set environment variable. Otherwise, sound code would have to be updated. I might look into this when I have more time.

ROCKNROLLKID commented 6 years ago

2.0.7 is now the latest, but nothing new on he sound backend. I don't think they have any plans to drop direct sound, as far as I am concerned.

hgdagon commented 6 years ago

@UCyborg since we're talking about sound, let me mention that I had a problem with all SDL apps on my current (Win10) laptop. I did not have that problem on my Win7 laptop, but, apparently, you need to define an environment variable for that to work. Surprisingly, I never defined that on my Win7 and all SDL apps (included those that failed on Win10) worked just fine...

UCyborg commented 6 years ago

It's possible to get the game to use WASAPI without altering the code passing the sound samples, so just calling SDL_OpenAudio with NULL obtained parameter, which makes SDL2 do the necessary conversions. Apparently passing audio to WASAPI can only be done using 32-bit float format, while the old sound code uses 16-bit integer format. I tried that, but it makes it sound kinda odd...

@hgdagon There's no sound in Berserker by default neither on Windows 7 under the same conditions with SDL 2.0.6 and above. Setting environment variable via batch file is one way, but it can also be set programmatically.