Skip to content

Commit fc3f5f5

Browse files
committed
Update SDL 2.0.16 - August 11 2021
1 parent 833d059 commit fc3f5f5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+9808
-4532
lines changed

README.md

+42-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SDL C VS Template (last update : April 11 2021)
1+
# SDL C VS Template (last update : August 11 2021)
22

33
Visual Studio 2019 solution to quickstart a C/SDL2 project : linking, sub-systems, includes, libs, dll, configs debug/release, x86/x64, gitignore...
44

@@ -8,15 +8,54 @@ Visual Studio 2019 solution to quickstart a C/SDL2 project : linking, sub-system
88

99
Latests libs updates :
1010

11-
* SDL 2.0.14
11+
* SDL 2.0.16
1212
* SDL_image 2.0.5
1313
* SDL_ttf 2.0.15
1414
* SDL_mixer 2.0.4
1515
* SDL_net 2.0.1
1616

17-
1817
This is a list of major changes in SDL's version history.
1918

19+
---------------------------------------------------------------------------
20+
2.0.16:
21+
---------------------------------------------------------------------------
22+
General:
23+
* Added SDL_FlashWindow() to get a user's attention
24+
* Added SDL_GetAudioDeviceSpec() to get the preferred audio format of a device
25+
* Added SDL_SetWindowAlwaysOnTop() to dynamically change the SDL_WINDOW_ALWAYS_ON_TOP flag for a window
26+
* Added SDL_SetWindowKeyboardGrab() to support grabbing the keyboard independently of the mouse
27+
* Added SDL_SoftStretchLinear() to do bilinear scaling between 32-bit software surfaces
28+
* Added SDL_UpdateNVTexture() to update streaming NV12/21 textures
29+
* Added SDL_GameControllerSendEffect() and SDL_JoystickSendEffect() to allow sending custom trigger effects to the DualSense controller
30+
* Added SDL_GameControllerGetSensorDataRate() to get the sensor data rate for PlayStation and Nintendo Switch controllers
31+
* Added support for the Amazon Luna game controller
32+
* Added rumble support for the Google Stadia controller using the HIDAPI driver
33+
* Added SDL_GameControllerType constants for the Amazon Luna and Google Stadia controllers
34+
* Added analog rumble for Nintendo Switch Pro controllers using the HIDAPI driver
35+
* Reduced CPU usage when using SDL_WaitEvent() and SDL_WaitEventTimeout()
36+
37+
Windows:
38+
* Added SDL_SetWindowsMessageHook() to set a function that is called for all Windows messages
39+
* Added SDL_RenderGetD3D11Device() to get the D3D11 device used by the SDL renderer
40+
41+
Linux:
42+
* Greatly improved Wayland support
43+
* Added support for audio output and capture using Pipewire
44+
* Added the hint SDL_HINT_AUDIO_INCLUDE_MONITORS to control whether PulseAudio recording should include monitor devices
45+
* Added the hint SDL_HINT_AUDIO_DEVICE_STREAM_ROLE to describe the role of your application for audio control panels
46+
47+
Android:
48+
* Added support for audio output and capture using AAudio
49+
* Added SDL_AndroidShowToast() to show a lightweight notification
50+
51+
iOS:
52+
* Added support for mouse relative mode on iOS 14.1 and newer
53+
* Added support for the Xbox Series X controller
54+
55+
tvOS:
56+
* Added support for the Xbox Series X controller
57+
58+
2059
---------------------------------------------------------------------------
2160
2.0.14:
2261
---------------------------------------------------------------------------

lib/sdl/BUGS.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

2-
Bugs are now managed in the SDL bug tracker, here:
2+
Bugs are now managed in the SDL issue tracker, here:
33

4-
https://bugzilla.libsdl.org/
4+
https://github.com/libsdl-org/SDL/issues
55

66
You may report bugs there, and search to see if a given issue has already
77
been reported, discussed, and maybe even fixed.
@@ -11,6 +11,6 @@ You may also find help at the SDL forums/mailing list:
1111

1212
https://discourse.libsdl.org/
1313

14-
Bug reports are welcome here, but we really appreciate if you use Bugzilla, as
15-
bugs discussed on the mailing list may be forgotten or missed.
14+
Bug reports are welcome here, but we really appreciate if you use the issue
15+
tracker, as bugs discussed on the mailing list may be forgotten or missed.
1616

lib/sdl/WhatsNew.txt

+40
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,46 @@
11

22
This is a list of major changes in SDL's version history.
33

4+
---------------------------------------------------------------------------
5+
2.0.16:
6+
---------------------------------------------------------------------------
7+
General:
8+
* Added SDL_FlashWindow() to get a user's attention
9+
* Added SDL_GetAudioDeviceSpec() to get the preferred audio format of a device
10+
* Added SDL_SetWindowAlwaysOnTop() to dynamically change the SDL_WINDOW_ALWAYS_ON_TOP flag for a window
11+
* Added SDL_SetWindowKeyboardGrab() to support grabbing the keyboard independently of the mouse
12+
* Added SDL_SoftStretchLinear() to do bilinear scaling between 32-bit software surfaces
13+
* Added SDL_UpdateNVTexture() to update streaming NV12/21 textures
14+
* Added SDL_GameControllerSendEffect() and SDL_JoystickSendEffect() to allow sending custom trigger effects to the DualSense controller
15+
* Added SDL_GameControllerGetSensorDataRate() to get the sensor data rate for PlayStation and Nintendo Switch controllers
16+
* Added support for the Amazon Luna game controller
17+
* Added rumble support for the Google Stadia controller using the HIDAPI driver
18+
* Added SDL_GameControllerType constants for the Amazon Luna and Google Stadia controllers
19+
* Added analog rumble for Nintendo Switch Pro controllers using the HIDAPI driver
20+
* Reduced CPU usage when using SDL_WaitEvent() and SDL_WaitEventTimeout()
21+
22+
Windows:
23+
* Added SDL_SetWindowsMessageHook() to set a function that is called for all Windows messages
24+
* Added SDL_RenderGetD3D11Device() to get the D3D11 device used by the SDL renderer
25+
26+
Linux:
27+
* Greatly improved Wayland support
28+
* Added support for audio output and capture using Pipewire
29+
* Added the hint SDL_HINT_AUDIO_INCLUDE_MONITORS to control whether PulseAudio recording should include monitor devices
30+
* Added the hint SDL_HINT_AUDIO_DEVICE_STREAM_ROLE to describe the role of your application for audio control panels
31+
32+
Android:
33+
* Added support for audio output and capture using AAudio
34+
* Added SDL_AndroidShowToast() to show a lightweight notification
35+
36+
iOS:
37+
* Added support for mouse relative mode on iOS 14.1 and newer
38+
* Added support for the Xbox Series X controller
39+
40+
tvOS:
41+
* Added support for the Xbox Series X controller
42+
43+
444
---------------------------------------------------------------------------
545
2.0.14:
646
---------------------------------------------------------------------------

lib/sdl/docs/README-android.md

+54-36
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ If you are using the older ant build process, it is no longer officially
1010
supported, but you can use the "android-project-ant" directory as a template.
1111

1212

13-
================================================================================
14-
Requirements
13+
Requirements
1514
================================================================================
1615

1716
Android SDK (version 26 or later)
@@ -23,8 +22,7 @@ https://developer.android.com/tools/sdk/ndk/index.html
2322
Minimum API level supported by SDL: 16 (Android 4.1)
2423

2524

26-
================================================================================
27-
How the port works
25+
How the port works
2826
================================================================================
2927

3028
- Android applications are Java-based, optionally with parts written in C
@@ -42,8 +40,7 @@ dispatches to native functions implemented in the SDL library:
4240
src/core/android/SDL_android.c
4341

4442

45-
================================================================================
46-
Building an app
43+
Building an app
4744
================================================================================
4845

4946
For simple projects you can use the script located at build-scripts/androidbuild.sh
@@ -120,8 +117,7 @@ Here's an explanation of the files in the Android project, so you can customize
120117
src/main/java/org/libsdl/app/SDLActivity.java - the Java class handling the initialization and binding to SDL. Be very careful changing this, as the SDL library relies on this implementation. You should instead subclass this for your application.
121118

122119

123-
================================================================================
124-
Customizing your application name
120+
Customizing your application name
125121
================================================================================
126122

127123
To customize your application name, edit AndroidManifest.xml and replace
@@ -151,17 +147,15 @@ Then replace "SDLActivity" in AndroidManifest.xml with the name of your
151147
class, .e.g. "MyGame"
152148

153149

154-
================================================================================
155-
Customizing your application icon
150+
Customizing your application icon
156151
================================================================================
157152

158153
Conceptually changing your icon is just replacing the "ic_launcher.png" files in
159154
the drawable directories under the res directory. There are several directories
160155
for different screen sizes.
161156

162157

163-
================================================================================
164-
Loading assets
158+
Loading assets
165159
================================================================================
166160

167161
Any files you put in the "app/src/main/assets" directory of your project
@@ -189,8 +183,7 @@ disable this behaviour, see for example:
189183
http://ponystyle.com/blog/2010/03/26/dealing-with-asset-compression-in-android-apps/
190184

191185

192-
================================================================================
193-
Pause / Resume behaviour
186+
Pause / Resume behaviour
194187
================================================================================
195188

196189
If SDL_HINT_ANDROID_BLOCK_ON_PAUSE hint is set (the default),
@@ -205,13 +198,37 @@ app can continue to operate as it was.
205198

206199
However, there's a chance (on older hardware, or on systems under heavy load),
207200
where the GL context can not be restored. In that case you have to listen for
208-
a specific message, (which is not yet implemented!) and restore your textures
209-
manually or quit the app (which is actually the kind of behaviour you'll see
210-
under iOS, if the OS can not restore your GL context it will just kill your app)
201+
a specific message (SDL_RENDER_DEVICE_RESET) and restore your textures
202+
manually or quit the app.
211203

204+
You should not use the SDL renderer API while the app going in background:
205+
- SDL_APP_WILLENTERBACKGROUND:
206+
after you read this message, GL context gets backed-up and you should not
207+
use the SDL renderer API.
212208

209+
- SDL_APP_DIDENTERFOREGROUND:
210+
GL context is restored, and the SDL renderer API is available (unless you
211+
receive SDL_RENDER_DEVICE_RESET).
212+
213+
Mouse / Touch events
214+
================================================================================
215+
216+
In some case, SDL generates synthetic mouse (resp. touch) events for touch
217+
(resp. mouse) devices.
218+
To enable/disable this behavior, see SDL_hints.h:
219+
- SDL_HINT_TOUCH_MOUSE_EVENTS
220+
- SDL_HINT_MOUSE_TOUCH_EVENTS
221+
222+
Misc
213223
================================================================================
214-
Threads and the Java VM
224+
225+
For some device, it appears to works better setting explicitly GL attributes
226+
before creating a window:
227+
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
228+
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 6);
229+
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
230+
231+
Threads and the Java VM
215232
================================================================================
216233

217234
For a quick tour on how Linux native threads interoperate with the Java VM, take
@@ -226,8 +243,17 @@ your thread automatically anyway (when you make an SDL call), but it'll never
226243
detach it.
227244

228245

229-
================================================================================
230-
Using STL
246+
If you ever want to use JNI in a native thread (created by "SDL_CreateThread()"),
247+
it won't be able to find your java class and method because of the java class loader
248+
which is different for native threads, than for java threads (eg your "main()").
249+
250+
the work-around is to find class/method, in you "main()" thread, and to use them
251+
in your native thread.
252+
253+
see:
254+
https://developer.android.com/training/articles/perf-jni#faq:-why-didnt-findclass-find-my-class
255+
256+
Using STL
231257
================================================================================
232258

233259
You can use STL in your project by creating an Application.mk file in the jni
@@ -239,8 +265,7 @@ For more information go here:
239265
https://developer.android.com/ndk/guides/cpp-support
240266

241267

242-
================================================================================
243-
Using the emulator
268+
Using the emulator
244269
================================================================================
245270

246271
There are some good tips and tricks for getting the most out of the
@@ -252,8 +277,7 @@ Notice that this software emulator is incredibly slow and needs a lot of disk sp
252277
Using a real device works better.
253278

254279

255-
================================================================================
256-
Troubleshooting
280+
Troubleshooting
257281
================================================================================
258282

259283
You can see if adb can see any devices with the following command:
@@ -332,8 +356,7 @@ If you need to build without optimization turned on, you can create a file calle
332356
APP_OPTIM := debug
333357

334358

335-
================================================================================
336-
Memory debugging
359+
Memory debugging
337360
================================================================================
338361

339362
The best (and slowest) way to debug memory issues on Android is valgrind.
@@ -384,8 +407,7 @@ When you're done instrumenting with valgrind, you can disable the wrapper:
384407
adb shell setprop wrap.org.libsdl.app ""
385408

386409

387-
================================================================================
388-
Graphics debugging
410+
Graphics debugging
389411
================================================================================
390412

391413
If you are developing on a compatible Tegra-based tablet, NVidia provides
@@ -398,8 +420,7 @@ The Tegra Graphics Debugger is available from NVidia here:
398420
https://developer.nvidia.com/tegra-graphics-debugger
399421

400422

401-
================================================================================
402-
Why is API level 16 the minimum required?
423+
Why is API level 16 the minimum required?
403424
================================================================================
404425

405426
The latest NDK toolchain doesn't support targeting earlier than API level 16.
@@ -408,8 +429,7 @@ about 99% of the Android devices accessing Google Play support API level 16 or
408429
higher (January 2018).
409430

410431

411-
================================================================================
412-
A note regarding the use of the "dirty rectangles" rendering technique
432+
A note regarding the use of the "dirty rectangles" rendering technique
413433
================================================================================
414434

415435
If your app uses a variation of the "dirty rectangles" rendering technique,
@@ -427,8 +447,7 @@ screen each frame.
427447
Reference: http://www.khronos.org/registry/egl/specs/EGLTechNote0001.html
428448

429449

430-
================================================================================
431-
Ending your application
450+
Ending your application
432451
================================================================================
433452

434453
Two legitimate ways:
@@ -445,8 +464,7 @@ Don't call exit() as it stops the activity badly.
445464
NB: "Back button" can be handled as a SDL_KEYDOWN/UP events, with Keycode
446465
SDLK_AC_BACK, for any purpose.
447466

448-
================================================================================
449-
Known issues
467+
Known issues
450468
================================================================================
451469

452470
- The number of buttons reported for each joystick is hardcoded to be 36, which

0 commit comments

Comments
 (0)