13957 Commits

Author SHA1 Message Date
Dimitriy Ryazantcev
6b28065e9e Reformat Win32 scan code table 2023-11-28 11:31:19 -08:00
Dimitriy Ryazantcev
7e86b6aef2 Win32: Fix keymap for keyboard layouts that can print UTF-16 surrogates and ligatures
Old implementation with `MapVirtualKey(..., MAPVK_VK_TO_CHAR) & 0x7FFFF` simply returned `A`..`Z` for VK_A..VK_Z and
completely useless <U+0002 START OF TEXT> (`WCH_LGTR 0xF002` without high-order bit) in case of ligature.

See https://kbdlayout.info/features/ligatures for a list of affected keyboard layouts.
More info on `MAPVK_VK_TO_CHAR`: https://stackoverflow.com/a/72464584/1795050
2023-11-28 11:11:33 -08:00
Ryan C. Gordon
08c6ac1b16 test: SDLTest_PrintEvent now reports key event mod state.
(cherry picked from commit d42fa25a9e850ca9a9c9c0879ca7fdee00c136d1)
2023-11-28 13:11:57 -05:00
Sam Lantinga
571e9796b9 Fixed the GameCube HIDAPI controller mapping
Fixes https://github.com/libsdl-org/SDL/issues/8617
Closes https://github.com/libsdl-org/SDL/pull/8623
Closes https://github.com/libsdl-org/SDL/pull/7930
2023-11-28 10:07:06 -08:00
Sam Lantinga
dd984dcd9f Removed HIDAPI controller mappings
These are already provided internally by SDL
2023-11-28 09:54:35 -08:00
Ryan C. Gordon
3817f5126e cocoa: Use -[NSApplicationDelegate applicationSupportsSecureRestorableState].
This prevents warnings at startup on macOS Sonoma (14.0).

(cherry picked from commit 7d25a443c45450287e0a3ec5c1eb0e417647070e)
2023-11-28 12:41:35 -05:00
Ryan C. Gordon
c5b0ff77d7 test: testwm2 now displays keyboard mod state.
(cherry picked from commit 258849c9bc2f28b2b6dcacbab4d415054539598c)
2023-11-28 12:10:57 -05:00
Anonymous Maarten
5772e00c3f cmake: disable oss by default on OpenBSD, not FreeBSD
This fixes ed3fad18808714f9fab3111a45d06264ea6fb0c5
2023-11-28 16:45:33 +01:00
Jake S. Del Mastro
ceac93ade2 Set framebuffer_srgb_capable to the actual value obtained (#8634)
(cherry picked from commit 594a79c2f9db21a11a76c012b2b1655a21fc8982)
2023-11-28 05:49:40 -08:00
Anonymous Maarten
ed3fad1880 cmake: disable oss by default on Linux, NetBSD and FreeBSD 2023-11-27 22:04:04 +01:00
Sylvain
6bb40f1d8d SDL_VideoCapture: allow add/remove device at runtime on linux 2023-11-27 16:01:10 -05:00
Sam Lantinga
f0e47f8ee0 Added support for the NACON Revolution 5 Pro controller 2023-11-27 12:10:00 -08:00
Ozkan Sezer
2f806c89b5 initial import of hidapi netbsd uhid native backend from mainstream
c19ae126d8
https://github.com/libusb/hidapi/pull/612
2023-11-26 20:20:28 +03:00
Christoph Reichenbach
1b284cd415 X11 pen detection: fix misclassification due to improper init
xinput2_device_is_pen() was testing against default-zero values
in the X11 Atom cache on at least the first round of
detections, leading to imprecise detection.

The patch fixes two aspects of initialisation:

1. Ensure that the selector cache is always initialised in
xinput2_device_is_pen().

2. Ensure that all X11 Atoms used in SDL_x11pen.c are instantiated if
missing. This ensures that they are never None and avoids potential
failures to detect hot-plugged tablet devices.

Acknowledgements: @tilman3 for narrowing down the issue and an
initial fix
2023-11-26 14:10:04 +03:00
Anonymous Maarten
c4ca64deaf ci: do 'brew update' & don't run dependent checks on installed things 2023-11-26 06:01:26 +01:00
Ozkan Sezer
d486de6349 cmake: fixed iconv detection test program
Fixes https://github.com/libsdl-org/SDL/issues/8614
2023-11-26 01:55:28 +03:00
Ryan C. Gordon
42a8139fd6
render: Clip bresenham lines against a real viewport thing.
You can't just use renderer->view->viewport, because it might be (0,0), -1x-1.

I _think_ this is more right?

Fixes #8609.
2023-11-25 01:51:35 -05:00
Ryan C. Gordon
4a40a272bd
render: Patched to compile.
Bad cherry-pick on my part, sorry!

Fixes #8609.
2023-11-24 22:47:44 -05:00
Ryan C. Gordon
983f178b7d
render: Clip lines before Bresenham algorithm generates points.
Otherwise, a massive line might generate gigabytes worth of points to render,
which the backend would simply throw away anyhow.

Fixes #8113.

(cherry picked from commit 4339647d900bb8559ac3f6258166d21fe6d72a9a)
2023-11-24 19:34:47 -05:00
Ryan C. Gordon
db7f6425d0
rect: Avoid numeric overflow on massive lines in SDL_IntersectRectAndLine.
Reference Issue #8301.
Reference Issue #8113.

(cherry picked from commit a391dd5fef70e0da4702d355b6331da5bf1f84a2)
2023-11-24 19:34:20 -05:00
Anonymous Maarten
e548044a82 ci: add NetBSD to test matrix
Co-authored-by: Ozkan Sezer <sezeroz@gmail.com>
2023-11-24 21:34:56 +01:00
Anonymous Maarten
dd5b8db3a6 SDL_hidapi requires libusb >= 1.0.16
Co-authored-by: Ozkan Sezer <sezeroz@gmail.com>
2023-11-24 21:31:59 +01:00
Ryan C. Gordon
6ba90f7775 render: Batching is always enabled now!
Make sure your app uses SDL_RenderFlush() before it talks to D3D/OpenGL/etc!

Fixes #8584.
2023-11-23 20:37:52 -05:00
Ryan C. Gordon
b24d6bd59a
opengl: Creating a texture trashes the cached texturing state, fix it.
Reference Issue #7194.

(cherry picked from commit e9b486937238680053bdf76b27693e120f00a70f)
2023-11-23 20:01:02 -05:00
Ryan C. Gordon
dcf04559db
render: GL-based renderers should treat adaptive vsync as vsync being enabled.
Fixes #8004.
2023-11-23 18:28:43 -05:00
Ryan C. Gordon
74a2542564
x11: Deal with difference in GLX_EXT_swap_control_tear behavior.
Mesa and Nvidia handle it differently, and one or the other may fix their
implementation in the future, so test which way it works at runtime.

Reference Issue #8004.
2023-11-23 13:56:51 -05:00
Ozkan Sezer
08fac5b1b2 SDL_PenModifyForWacomID: return zero as axis_flags upon failure.
Fixes uninitialized warning in testautomation_pen.c:
testautomation_pen.c:1512: warning: 'mask' may be used uninitialized in this function
2023-11-23 11:56:50 +03:00
Ozkan Sezer
aaba01aee4 hidapi: syncing with mainstream:
- macos, pthread_barrier_wait: properly check the wait condition
- windows: Assert that struct has the correct size
- windows: Fix printf/string-related issues
- other miscellaneous stuff irrelevant in SDL. (for symmetry...)
2023-11-23 11:35:02 +03:00
Ozkan Sezer
5730eb67f0 add HAVE_GCC_DIAGNOSTIC_PRAGMA to SDL_internal.h, use it 2023-11-23 11:33:20 +03:00
Ozkan Sezer
42c8366fdc revise iconv detection:
- check libiconv with a linkage test with iconv.h included
- check libc iconv with a linkage test with iconv.h included
  and LIBICONV_PLUG defined (in case libiconv header is in
  include path)
- add new configuration option to prefer iconv from libiconv,
  if available, over the libc version: SDL_LIBICONV, defaults
  to disabled.
- remove FindIconv + pkg_check_modules for iconv, and use our
  manual iconv finding only
- change FreeBSD specific LIBICONV_PLUG define in SDL_iconv.c
  to configuration result.
2023-11-23 04:30:56 +03:00
Anonymous Maarten
a45b371de0 cmake: create and install SDL3::Jar target for Android 2023-11-23 02:13:08 +01:00
Ozkan Sezer
53544cabaa psp: fix copy/paste error from SDL2 in PSP_VideoQuit(). 2023-11-23 04:11:24 +03:00
Ryan C. Gordon
6cde96f9a0
psp: Hook up event subsystem init/quit.
Fixes #8554.

(cherry picked from commit 0e9d050296ba754d23e82752eb1bd61221768586)
2023-11-22 18:03:29 -05:00
Ryan C. Gordon
e9659f5738
Removed some function declarations that don't actually exist.
Reference Issue #8554.

(cherry picked from commit 87875a49b4cfc277aba6d2c4c32769a29767e561)
2023-11-22 17:58:54 -05:00
Ryan C. Gordon
3264e64738
SDL_RunApp: Make sure argc/argv are stable if the caller didn't define them.
Fixes #8246.
2023-11-22 17:34:39 -05:00
Sam Lantinga
eca79e38db Removed test shape images 2023-11-22 14:11:10 -08:00
Sam Lantinga
81fc7ded78 Removed the window shape API for SDL 3.0
Fixes https://github.com/libsdl-org/SDL/issues/6654
Fixes https://github.com/libsdl-org/SDL/issues/6897
2023-11-22 14:11:10 -08:00
Sam Lantinga
45938bbfa5 Corrected comment 2023-11-22 10:35:15 -08:00
zoeyjodon
059e550e98
Fix 3DS Analog Values (#8581) 2023-11-22 10:34:01 -08:00
zoey jodon
dbf14df80f Fix joysticks returning invalid device IDs 2023-11-22 10:33:11 -08:00
Anonymous Maarten
d2db3f3993 ci: cache android ndk archive 2023-11-22 19:22:31 +01:00
Anonymous Maarten
d6291d4d42 alloca: use alloca from <stdlib.h> on NetBSD
The only generally portable way to do this is to use -std=gnu99,
"#include <stdlib.h>", and write "alloca".
__builtin_alloca does not seem to be available on NetBSD
2023-11-22 06:33:50 +03:00
Anonymous Maarten
f26a93211f SDL_bsdjoystick: fix -Wundef warning on FreeBSD 2023-11-22 06:23:00 +03:00
Ozkan Sezer
d1def7f033 cmake: add openbsd wscons sources to build, if supported 2023-11-22 06:21:28 +03:00
Ozkan Sezer
86d77bbcc5 kmsdrm: restrict KMSDRM_ReleaseVT/KMSDRM_AcquireVT to SDL_INPUT_LINUXEV 2023-11-22 06:21:28 +03:00
Ozkan Sezer
94ad1a4ae4 SDL_bsdjoystick.c: fix -Wundef warning. 2023-11-22 06:21:28 +03:00
Sam Lantinga
e761770c24 No, this wasn't right 2023-11-21 15:26:53 -08:00
Sam Lantinga
b7d7e54895 Fixed uninitialized variable 2023-11-21 15:26:34 -08:00
Sam Lantinga
119e02f314 Always use 'm' for controllers provided by the MFI joystick driver
This makes sure that SDL_JoystickGUIDUsesVersion() returns false and we don't try to match against other similar controllers using old mappings.
2023-11-21 15:19:23 -08:00
Sam Lantinga
75df4cc5c2 Don't tickle PS4 Bluetooth controllers in simple mode
The 8BitDo Zero 2 only sends reports when state changes, so trips the disconnected Bluetooth controller detection. The expected use case is that most people will have official PS4 controllers in enhanced report mode, so disconnected Bluetooth controller detection will still work for those.

Fixes https://github.com/libsdl-org/SDL/issues/8556
2023-11-21 13:25:02 -08:00