In addition to lots of bug fixes and build improvements, here are the major
changes in this release:
General:
Added cross-platform Vulkan graphics support in SDL_vulkan.h
SDL_Vulkan_LoadLibrary()
SDL_Vulkan_GetVkGetInstanceProcAddr()
SDL_Vulkan_GetInstanceExtensions()
SDL_Vulkan_CreateSurface()
SDL_Vulkan_GetDrawableSize()
SDL_Vulkan_UnloadLibrary()
This is all the platform-specific code you need to bring up Vulkan on all SDL platforms. You can look at an example in test/testvulkan.c
Added SDL_ComposeCustomBlendMode() to create custom blend modes for 2D rendering
Added SDL_HasNEON() which returns whether the CPU has NEON instruction support
Added support for many game controllers, including the Nintendo Switch Pro Controller
Added support for inverted axes and separate axis directions in game controller mappings
Added functions to return information about a joystick before it’s opened:
SDL_JoystickGetDeviceVendor()
SDL_JoystickGetDeviceProduct()
SDL_JoystickGetDeviceProductVersion()
SDL_JoystickGetDeviceType()
SDL_JoystickGetDeviceInstanceID()
Added functions to return information about an open joystick:
SDL_JoystickGetVendor()
SDL_JoystickGetProduct()
SDL_JoystickGetProductVersion()
SDL_JoystickGetType()
SDL_JoystickGetAxisInitialState()
Added functions to return information about an open game controller:
SDL_GameControllerGetVendor()
SDL_GameControllerGetProduct()
SDL_GameControllerGetProductVersion()
Added SDL_GameControllerNumMappings() and SDL_GameControllerMappingForIndex() to be able to enumerate the built-in game controller mappings
Added SDL_LoadFile() and SDL_LoadFile_RW() to load a file into memory
Added SDL_DuplicateSurface() to make a copy of a surface
Added an experimental JACK audio driver
Implemented non-power-of-two audio resampling, optionally using libsamplerate to perform the resampling
Added the hint SDL_HINT_AUDIO_RESAMPLING_MODE to control the quality of resampling
Added the hint SDL_HINT_RENDER_LOGICAL_SIZE_MODE to control the scaling policy for SDL_RenderSetLogicalSize():
“0” or “letterbox” - Uses letterbox/sidebars to fit the entire rendering on screen (the default)
“1” or “overscan” - Will zoom the rendering so it fills the entire screen, allowing edges to be drawn offscreen
Added the hints SDL_HINT_MOUSE_NORMAL_SPEED_SCALE and SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE to scale the mouse speed when being read from raw mouse input
Added the hint SDL_HINT_TOUCH_MOUSE_EVENTS to control whether SDL will synthesize mouse events from touch events
Windows:
The new default audio driver on Windows is WASAPI and supports hot-plugging devices and changing the default audio device
The old XAudio2 audio driver is deprecated and will be removed in the next release
Added hints SDL_HINT_WINDOWS_INTRESOURCE_ICON and SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL to specify a custom icon resource ID for SDL windows
The hint SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING is now on by default for compatibility with .NET languages and various Windows debuggers
Updated the GUID format for game controller mappings, older mappings will be automatically converted on load
Implemented the SDL_WINDOW_ALWAYS_ON_TOP flag on Windows
Linux:
Added an experimental KMS/DRM video driver for embedded development
I’m getting no sound: “Unsupported audio format”. Before, I was getting sound, but no music from MODPLUG. If the new DLL gets pushed through Steam, my game will break. 2.0.5 works no problem.
Something odd is happening with the sound in 2.0.6: I sometimes get a blip of sound as if a sample works for a split second. And if I use my developer menu to build the game resources, the sound effects work for a while (but still no music). There is always the possibility I could be doing something wrong my end which didn’t break pre 2.0.6. I will dig deeper and see if I can recreate the problem in a minimal example.
I’ve never been successful in rebuilding any SDL stuff from source. I get numerous errors from make.exe that I can’t solve. I have to rely on the binaries.
When I call Mix_OpenAudio(), I set the audio format to AUDIO_S16LSB.
Then when I call Mix_QuerySpec() it seems the audio format has been changed to AUDIO_F32LSB.
That’s to be expected. I believe the new audio device (WASAPI ) is F32 only, This is why someone thought I was getting no sound in the pre-release, because the F32 and S32 mixers weren’t implemented - which has now done. I can’t try the new SDL_mixer because I don’t know how to build them from source (I get errors when I run make). But if I’m getting a glimpse of it working, there’s something else going on.
I’ve found what’s happening. Mix_PlayMusic() is silencing all sound channels. Mix_HaltMusic() will unmute the channels so they will play normally.
This didn’t happen in the 2.0.6 pre-release - only music (using MIX_INIT_MODPLUG) stopped working, but sounds still played.
I’ve spent hours trying to build SDL_mixer from source, but I can’t do it. I get make errors. I don’t really know how to use Linux. I got as far as linking the source code into Eclipse, but I got an error something like “Mixer not built with libmod support”. Every forum I have searched has people posting about the same problem but nobody’s posted a solution. Can we have a new SDL_mixer version?
I’ve put together this test code. Pressing 1 will play the sample no problem until pressing 2 to play the mod will silence everything. Pressing 3 to halt the mod will unmute the wav.
Music is also still silent (using MIX_INIT_MODPLUG). No errors are returned, just silence. This worked in 2.0.5.
In Win7 I’m unable to use the precompiled 64-bit 2.0.6 SDL2.dll from the dev library as a drop-in replacement for the 64-bit 2.0.5 dll in a game I’m working on. Upon running the game Win7 tells me my exe has stopped working and Windows is checking for a solution. If I’m remembering things correctly, binary compatibility is so good with SDL that’s supposed to work, isn’t it?
For comparison, I copied the whole install directory to Win8 and it worked with either dll. In a different 32-bit project I was able to replace a SDL2.dll from around 2013 with both the 2.0.5 and 2.0.6 precompiled dlls. And of course I haven’t had any problems on Linux yet.
Indeed it should. The only issue I can currently think of is if you’re using the opengl renderer and Windows drops back to the OpenGL 1.1 software renderer and SDL accesses a NULL pointer. This should be rare as the direct3d renderer is usually preferred on Windows.
I know the dev package doesn’t have the debugging infos in it, but a debugger should at least be able to tell us in which symbol it explodes. Can you check that?
@icculus, @slouken: I just noticed that SDL2-devel-2.0.6-VC.zip has the GCC DLLs in it. Is this intentional?
Thanks for verifying, ChliHug. It is indeed an OpenGL game. I don’t have a debugger installed yet since I compiled with Microsoft Build Tools. But I got it to run once tonight with horrible flickering triangles everywhere. My money says it’s a graphics driver bug. I’ll keep digging…
Hi! I’m getting “warning incorrect audio” with mp3 files (SDL 2.0.6 and latest old mixer 2.0.1). Moreother, even if I have .wav files loaded correctly - they wouldn’t play because of error. Did anybody solved old mixer issue or rebuild new dll from Mercurial to get it work?
Yes it does, thank you! However, I’ve had to increase the sound buffer x3 to get it then stop crashing, and I get a popping sound after each sound (https://bugzilla.libsdl.org/show_bug.cgi?id=3851). I think I’ll just stick with 2.0.5 for now…