Commit graph

11700 commits

Author SHA1 Message Date
Sam Lantinga 79a8e8cf04 Make built-in joystick device lists extendable by using hints
Fixes https://github.com/libsdl-org/SDL/issues/8595

(cherry picked from commit 5173b0c2cce5a68f1f72d77b4788f5e1da332719)
2023-12-10 22:52:12 -08:00
Sam Lantinga 6526c4d0fc Refactor VIDPID list loading code
(cherry picked from commit d91e96e7f50b9c3cb0e1dacda39274b4af037a96)
2023-12-10 09:02:56 -08:00
Sam Lantinga f0e7f3e7e5 Back out Steam virtual gamepad changes
We are planning a different approach to handle these
2023-12-10 08:38:20 -08:00
Anonymous Maarten 10c292b055 cmake+xcode: use IMPORTED SHARED framework target 2023-12-10 11:50:11 +01:00
Sam Lantinga ddac844034 Fixed build 2023-12-09 21:44:12 -08:00
Sam Lantinga dd28637947 Use the Steam virtual gamepad slot as the gamepad player index
(cherry picked from commit 7529d25b2b99e2f790c418e479e7ce85c1c818e6)
2023-12-09 21:01:08 -08:00
Sam Lantinga 5b26d4e0ca Sort Steam virtual gamepads by Steam controller slot
This makes sure that games launched by Steam see the first controller first, and the controllers in the game match up with the controllers in the Steam UI.

Fixes https://github.com/libsdl-org/SDL/issues/8672

(cherry picked from commit 17723381da9bc3eadb129beaeaed2164c64b5155)
2023-12-09 20:35:33 -08:00
Ethan Lee 757c984ddb gamecontroller: Backport 3.0 'type:' field to 2.0 2023-11-30 14:42:56 -08:00
Ryan C. Gordon 61cd57d378 cocoa: Resync modifier keypressed on NSEventTypeFlagsChanged event.
Fixes #7507.

(cherry picked from commit 70b65d4170bbff6a8c2ffc9b5834ec85384f6fc0)
2023-11-29 21:40:30 -05:00
Anonymous Maarten 0134672345 cmake: copy sources to binary directory in separate target
Don't do it in POST_BUILD to avoid multiple parallel builds
stepping on each others toes.
Also don't use copy_if_different, but unconditionally copy it.
The build system should take care of dependencies.

SDL2 backport of fea6e7afb1c13326f463aef47ecd26396d1e3a2f
2023-11-28 23:03:30 +01:00
Sam Lantinga 8f14dc6998 Corrected comment
(cherry picked from commit 45938bbfa532e4c1cdef202a72d899a37a7baf05)
2023-11-28 12:30:10 -08:00
zoeyjodon 3381828cc6 Fix 3DS Analog Values (#8581)
(cherry picked from commit 059e550e981e7b2a654b54f548c64a73f5a5fe13)
2023-11-28 12:29:55 -08:00
shenleban tongying be0e303ec8 document the purpose of SDL_SetTextInputRect
(cherry picked from commit 3e6513c77390969cd870726690bf89e39fe91e60)
2023-11-28 12:11:31 -08:00
Sam Lantinga 546bab0a8c 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:26:58 -08:00
Sam Lantinga 98ee4a5292 Removed HIDAPI controller mappings
These are already provided internally by SDL

(cherry picked from commit dd984dcd9f89c88e2dd96769d2d837af90be7e70)
2023-11-28 10:11:56 -08:00
Ryan C. Gordon d42fa25a9e test: SDLTest_PrintEvent now reports key event mod state. 2023-11-28 13:07:56 -05:00
Ryan C. Gordon 7d25a443c4 cocoa: Use -[NSApplicationDelegate applicationSupportsSecureRestorableState].
This prevents warnings at startup on macOS Sonoma (14.0).
2023-11-28 12:24:33 -05:00
Ryan C. Gordon 3fbaf737ef test: Removed unnecessary line added by copy/paste error. 2023-11-28 12:11:13 -05:00
Ryan C. Gordon 258849c9bc test: testwm2 now displays keyboard mod state. 2023-11-28 12:05:02 -05:00
Jake S. Del Mastro 594a79c2f9
Set framebuffer_srgb_capable to the actual value obtained (#8634) 2023-11-28 05:48:19 -08:00
Sam Lantinga 8d47e3bb82 Added support for the NACON Revolution 5 Pro controller
(cherry picked from commit f0e47f8ee07410e29dcba8a13c91f3e2ef3c92b1)
2023-11-27 12:12:25 -08:00
Ozkan Sezer bbcf40e811 cmake: fixed iconv detection test program
Fixes https://github.com/libsdl-org/SDL/issues/8614
2023-11-26 01:55:24 +03:00
CasualPokePlayer 0fb36f29a8
cmake: check if CMP0087 exists before setting it (#8613)
Fixes builds using < CMake 3.14
2023-11-25 21:42:55 +00:00
Ryan C. Gordon 4339647d90
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.
2023-11-24 19:33:04 -05:00
Ryan C. Gordon a391dd5fef
rect: Avoid numeric overflow on massive lines in SDL_IntersectRectAndLine.
Reference Issue #8301.
Reference Issue #8113.
2023-11-24 19:33:04 -05:00
Ozkan Sezer 657f5f791c autotools: fix actually wrong use of AC_MSG_RESULT 2023-11-24 14:37:40 +03:00
Ryan C. Gordon e9b4869372
opengl: Creating a texture trashes the cached texturing state, fix it.
Reference Issue #7194.
2023-11-23 20:00:01 -05:00
Ryan C. Gordon 0a6b5abf45
render: GL-based renderers should treat adaptive vsync as vsync being enabled.
Fixes #8004.
2023-11-23 18:29:19 -05:00
Ryan C. Gordon d8102bf660
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.

(cherry picked from commit 74a25425646d64edeff508ec8e99622a41576905)
2023-11-23 18:17:25 -05:00
Ozkan Sezer 489e9b69df autotools: bump minimum needed autoconf version to 2.65.
older versions seem to output a broken configure script.
2023-11-24 01:01:20 +03:00
Anonymous Maarten baaac5cca3 cmake: Android expects SDL programs to be built as shared libraries 2023-11-23 03:39:36 +01:00
Anonymous Maarten 5abcfdb93e SDL_stdinc.h: fix compile warning when using SDL_PR[iux]64 on Android 2023-11-23 03:38:59 +01:00
Ozkan Sezer 8cf7e9e7da autotools, cmake: set SDL_SYSTEM_ICONV to OFF for windows (like SDL3.) 2023-11-23 03:32:04 +03:00
Ryan C. Gordon 0e9d050296
psp: Hook up event subsystem init/quit.
Fixes #8554.
2023-11-22 17:59:36 -05:00
Ryan C. Gordon 87875a49b4
Removed some function declarations that don't actually exist.
Reference Issue #8554.
2023-11-22 17:54:57 -05:00
Ozkan Sezer 17e62abb6d 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, defaults to disabled:
  SDL_LIBICONV for cmake, --enable-libiconv for autotools.
- change FreeBSD specific LIBICONV_PLUG define in SDL_iconv.c
  to configuration result.
2023-11-22 23:29:00 +03:00
Anonymous Maarten 4940b5dbc2 SDL_bsdjoystick: fix -Wundef warning on FreeBSD 2023-11-22 06:50:00 +03:00
Ozkan Sezer 3fb5124174 cmake: add openbsd wscons sources to build, if supported 2023-11-22 05:10:02 +03:00
Ozkan Sezer 59b0a2d711 kmsdrm: restrict KMSDRM_ReleaseVT/KMSDRM_AcquireVT to SDL_INPUT_LINUXEV 2023-11-22 05:10:02 +03:00
Sam Lantinga dcd21d042f Improved GCController handling on Apple platforms
Automatically map controllers as gamepads when using the GCController framework and prefer the physicalInputProfile when possible.

Testing with macOS 13.4.1, macOS 14.1.1, iOS 15.7.4, tvOS 17.1:
* iBuffalo Classic USB Gamepad (macOS only)
* Logitech F310 (macOS only)
* Apple TV remote (tvOS only)
* Nimbus MFi controller
* PS4 DualShock controller
* PS5 DualSense controller
* Xbox Series X controller
* Xbox Elite Series 2 controller
* Nintendo Switch Pro controller
* Nintendo Switch Joy-Con controllers

(cherry picked from commit 0fe5713964287b17e05eb09dd4f83d8580dba254)
Author: Sam Lantinga <slouken@libsdl.org>
Date:   Tue Nov 14 12:58:33 2023 -0800
2023-11-21 15:17:53 -08:00
Sam Lantinga 2d81beb819 Show the mapping used when a game controller is opened 2023-11-21 13:49:38 -08:00
Sam Lantinga 4de4b1e7a0 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

(cherry picked from commit 75df4cc5c2cd6b098f49855437c5262263489eab)
2023-11-21 13:25:31 -08:00
Cameron Cawley f33ab44f84 Extend blitting support for all <8bpp formats 2023-11-20 15:50:51 -08:00
Cameron Cawley 67eb03400a Add SDL_PIXELFORMAT_INDEX2LSB and SDL_PIXELFORMAT_INDEX2MSB 2023-11-20 15:50:51 -08:00
Ryan C. Gordon cb5b8c9747
testshader: Don't make local variables with the same name as GL entry points.
Reference Issue #2706.
2023-11-20 15:10:30 -05:00
Ryan C. Gordon c331b64d79
audio: Tighten up possession of detectionLock during device open.
We don't need it for most of the time, and holding it during the backend's
OpenDevice upsets ThreadSanitizer vs our PulseAudio code.

Fixes #7427.
2023-11-20 01:01:49 -05:00
Ryan C. Gordon e51760e111
audio: Wait for device thread to set device->threadid before continuing.
This fixes a (likely harmless) race condition in `is_in_audio_device_thread`.

Reference Issue #7427.
2023-11-19 12:26:51 -05:00
Deve c67ff82377 Avoid textinput events when pasting from clipboard on iOS.
I handle command+C and command+V shortcuts for copy/paste from clipboard using
SDL_GetClipboardText/SDL_SetClipboardText. But on iOS command+V shortcut is
also handled by system, so that I also get textinput event with that clipboard
text. And thus the application gets this clipboard text twice (from
SDL_GetClipboardText and from textinput event).

I assume that intended behavior is that command+V shouldn't generate textinput
events. At least as far as I know ctrl+V on other platforms does nothing. This
commit disables paste action for UITextField, so that textinput event isn't
generated anymore.

(cherry picked from commit eddaf870f5b57bbdb7f1cf08bacc4f997806d9a7)
2023-11-19 08:20:01 -08:00
Ryan C. Gordon 42d979a231
audio: Just use the system default stack size for the device thread.
Fixes #7367.
2023-11-19 11:10:29 -05:00
Cameron Cawley 1bb5448fe8 Use the correct pixel formats for OpenGL ES on big endian 2023-11-17 15:03:37 -08:00