Commit Graph

11692 Commits

Author SHA1 Message Date
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
Ozkan Sezer
2222f44c94 use format string attributes for functions accepting va_list params, too 2023-11-17 15:56:10 +03:00
Anonymous Maarten
d81d986858
cmake: fix uses of undefined macro identifiers (-Wundef) 2023-11-17 03:06:26 +00:00
Sam Lantinga
cc7c0a2dab Fixed IOS_SupportedHIDDevice() returning SDL_FALSE before initialization
(cherry picked from commit 34392db9c38ef71b57825e8e5a7428a577e9870d)
2023-11-14 10:58:18 -08:00
Sam Lantinga
76cc24e34a Added SDL_HINT_JOYSTICK_IOKIT and SDL_HINT_JOYSTICK_MFI to control whether the IOKit and GCController drivers should be used for joystick support.
This can be used to work around issues where the Apple GCController driver doesn't work for some controllers but there's no way to know which GCController maps to which IOKit device.

(cherry picked from commit 708f18d49ef6975769865d247e2ce4da6ce8da76)
2023-11-14 10:32:52 -08:00
Sam Lantinga
0ec1209eab Fixed a memory leak at window creation.
Windows updates the desktop display mode once at video init (in WIN_InitModes()) and once when creating a window (in WIN_RefreshDisplays())

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

(cherry picked from commit bea34c53804ada8d90c94aba27262635513452d3)
2023-11-14 09:29:55 -08:00
Louis M
925362a2fc Replacing SDL_SCANCODE_AUDIOMUTE by SDL_SCANCODE_MUTE on Windows 2023-11-14 09:26:15 -08:00
Sam Lantinga
1de85491e1 Fixed mouse wheel scrolling direction on iOS
(cherry picked from commit 15504da0b830aacdb8f8301e22ba5eb6ea9eb1b0)
2023-11-14 09:25:04 -08:00
Sam Lantinga
cc20d0147e Revert "Check to make sure the Windows joystick device has buttons and axes"
This reverts commit ad0af488837e44cbea0f0eab3b2f73b50a74bff4.

It turns out the ROG PUGIO II actually enumerates as a gamepad, so this change didn't have any effect anyway. We're getting lots of reports of people's racing pedals and similar devices no longer showing up, so we'll revert this again.

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

(cherry picked from commit 2c1fbe1967457c6b95323a5ea4136849c66bc307)
2023-11-13 21:37:18 -08:00