Skip to content

Commit 1d10f34

Browse files
committed
Update SDL2 version from 2.24.2 to 2.26.0
This is just a minor update to see if its any better than #20268
1 parent ff35d3f commit 1d10f34

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

test/browser/test_sdl2_key.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ int main(int argc, char **argv) {
6262

6363
SDL_StartTextInput();
6464

65-
emscripten_run_script("keydown(38);keyup(38)"); // up
66-
emscripten_run_script("keydown(40);keyup(40);"); // down
67-
emscripten_run_script("keydown(37);keyup(37);"); // left
68-
emscripten_run_script("keydown(39);keyup(39);"); // right
69-
emscripten_run_script("keydown(65);keyup(65);"); // a
70-
emscripten_run_script("keydown(66);keyup(66);"); // b
71-
emscripten_run_script("keydown(100);keyup(100);"); // trigger the end
65+
emscripten_run_script("keydown(38, 'ArrowUp'); keyup(38, 'ArrowUp')"); // up
66+
emscripten_run_script("keydown(40, 'ArrowDown'); keyup(40, 'ArrowWDown')"); // down
67+
emscripten_run_script("keydown(37, 'ArrowLeft'); keyup(37, 'ArrowLeft');"); // left
68+
emscripten_run_script("keydown(39, 'ArrowRight');keyup(39, 'ArrowRight');"); // right
69+
emscripten_run_script("keydown(65, 'KeyA'); keyup(65, 'KeyA');"); // a
70+
emscripten_run_script("keydown(66, 'KeyB'); keyup(66, 'KeyB');"); // b
71+
emscripten_run_script("keydown(100,'KeyD'); keyup(100,'KeyD');"); // trigger the end
7272

7373
emscripten_set_main_loop(pump_events, 3, 0);
7474
return 99;

test/browser/test_sdl2_mouse.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ void one() {
2525
printf("motion : %d,%d %d,%d\n", m->x, m->y, m->xrel, m->yrel);
2626

2727
if (mouse_motions == 0) {
28+
// Starting with SDL 2.26.0 initual xrel and yrel values are zero
29+
// See: https://github.com/libsdl-org/SDL/commit/0e61c106
2830
#ifdef TEST_SDL_MOUSE_OFFSETS
29-
assert(eq(m->x, 5) && eq(m->y, 15) && eq(m->xrel, 5) && eq(m->yrel, 15));
31+
assert(eq(m->x, 5) && eq(m->y, 15) && eq(m->xrel, 0) && eq(m->yrel, 0));
3032
#else
31-
assert(eq(m->x, 10) && eq(m->y, 20) && eq(m->xrel, 10) && eq(m->yrel, 20));
33+
assert(eq(m->x, 10) && eq(m->y, 20) && eq(m->xrel, 0) && eq(m->yrel, 0));
3234
#endif
3335
} else if (mouse_motions == 1) {
3436
#ifdef TEST_SDL_MOUSE_OFFSETS

test/test_browser.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3039,19 +3039,19 @@ def test_sdl2_image_formats(self):
30393039
@no_wasm64('SDL2 + wasm64')
30403040
def test_sdl2_key(self):
30413041
create_file('pre.js', '''
3042-
function keydown(c) {
3043-
var event = new KeyboardEvent("keydown", { 'keyCode': c, 'charCode': c, 'view': window, 'bubbles': true, 'cancelable': true });
3042+
function keydown(keyCode, code) {
3043+
var event = new KeyboardEvent("keydown", { keyCode, code, charCode: keyCode, 'view': window, 'bubbles': true, 'cancelable': true });
30443044
var prevented = !document.dispatchEvent(event);
30453045
30463046
//send keypress if not prevented
30473047
if (!prevented) {
3048-
var event = new KeyboardEvent("keypress", { 'keyCode': c, 'charCode': c, 'view': window, 'bubbles': true, 'cancelable': true });
3048+
var event = new KeyboardEvent("keypress", { keyCode, code, charCode: keyCode, 'view': window, 'bubbles': true, 'cancelable': true });
30493049
document.dispatchEvent(event);
30503050
}
30513051
}
30523052
3053-
function keyup(c) {
3054-
var event = new KeyboardEvent("keyup", { 'keyCode': c, 'charCode': c, 'view': window, 'bubbles': true, 'cancelable': true });
3053+
function keyup(keyCode, code) {
3054+
var event = new KeyboardEvent("keyup", { keyCode, code, charCode: keyCode, 'view': window, 'bubbles': true, 'cancelable': true });
30553055
document.dispatchEvent(event);
30563056
}
30573057
''')

tools/ports/sdl2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
import os
77

8-
TAG = 'release-2.24.2'
9-
HASH = 'b178bdc8f7c40271e09a72f639649d1d61953dda4dc12b77437259667b63b961fd3b2c67b0de6fdc5f9f9c80c49bfafd164e4c13715bc1056e550acc8bad5a3c'
8+
TAG = 'release-2.26.0'
9+
HASH = '2e53af5aa3d3ca7e2b8653f999379bf424b2190aad32a7997350fc058624818cca3a780907af74c8f72305ca18a83a2aa15839e1dbc94107128125a7df9cd7fd'
1010
SUBDIR = 'SDL-' + TAG
1111

1212
variants = {'sdl2-mt': {'PTHREADS': 1}}

0 commit comments

Comments
 (0)