Commit graph

1496 commits

Author SHA1 Message Date
Sam Lantinga 859844eae3 Updated to version 2.30.0 for release 2024-02-01 16:02:20 -08:00
Sam Lantinga 4a62e1c0ca Updated to version 2.29.3 for RC build 2024-01-27 22:50:08 -08:00
Sam Lantinga a6d5c1fe05 Added the environment variable SDL_LOGGING to control default log output
(cherry picked from commit 12bdb2b4d04a7338a4687755967a3eaad25696b0)
(cherry picked from commit f0b8fee88f4f37eecf0d16b146ff0171804298e7)
2024-01-27 19:46:59 -08:00
Sam Lantinga e767840874 Document that the default log priority is error, not critical
(cherry picked from commit a7a98d8bbb8976a7c55a734f1ac420c5d43763a8)
(cherry picked from commit 2c110685698b45e51527a9b0fc8b4406e13ee102)
2024-01-27 19:46:58 -08:00
Ryan C. Gordon 5f6a4fe643
blendmode: Corrected docs for SDL_BLENDOPERATION_[REV_]SUBTRACT.
They were documented backwards.

Fixes #8910.

(cherry picked from commit ecbbef8b8df954da96829c06bac4ad208f83dddd)
2024-01-25 17:49:55 -05:00
Sam Lantinga ef7261bc41 Updated to version 2.29.2 for RC build 2024-01-22 08:43:05 -08:00
Sam Lantinga b4f99deb9e Updated to version 2.29.1 for RC build 2024-01-19 19:58:24 -08:00
Ryan C. Gordon f7f9478caf
docs: Note SDL_UpdateWindowSurfaceRects can update beyond specified areas.
Reference Issue #8825.
2024-01-16 15:23:56 -05:00
Simon McVittie b1a82b5772 gamecontroller: Fix function name in cherry-picked documentation
SDL_GetGamepadAxis() is a SDL3-specific name: SDL2 calls gamepads
"game controllers".

Fixes: d3c21666 "gamepad: Clarify range and direction of axes"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2024-01-08 11:09:55 -08:00
Sam Lantinga d3c21666de gamepad: Clarify range and direction of axes
It would be easy to assume that all APIs that reference
SDL_JOYSTICK_AXIS_MAX work the same way, but they do not: triggers
generally use the full signed 16-bit range in the lower-level joystick
API, but are normalized to be non-negative by the higher-level gamepad
API.

We also never said explicitly which direction is positive here.
Experimentally, it's right (X), down (Y), and pressed (triggers).

Resolves: https://github.com/libsdl-org/SDL/issues/8793
Signed-off-by: Simon McVittie <smcv@collabora.com>

(cherry picked from commit 059fb560ba98df5668e1cf1c88560b3156e0fb66)
2024-01-08 09:48:04 -08:00
Sam Lantinga 5e12e4b813 Updated documentation for SDL_HINT_SHUTDOWN_DBUS_ON_QUIT
(cherry picked from commit 3deefa6b438922d5d55cb881482f8550f51978b7)
2024-01-07 14:24:56 -08:00
Semphris 8c4e4d57b3 Add hint to make SDL handle dbus_shutdown()
(cherry picked from commit 2348e8b6a2598af2790937a62ee49cdb02d6bd28)
2024-01-07 14:23:57 -08:00
J. Neuschäfer b1ad45acdd Fix memory barriers on ARMv5
The ARM926EJ-S Technical Reference Manual states:

> You can only access CP15 registers with MRC and MCR instructions in a
> privileged mode. CDP, LDC, STC, MCRR, and MRRC instructions, and unprivileged
> MRC or MCR instructions to CP15 cause the Undefined instruction exception to
> be taken.

Furthermore, `MCR p15, 0, <Rd>, c7, c10, 5` (later called Data Memory Barrier)
is not specified for the ARM926. Thus, SDL should not use these cache
instructions on ARMv5.

(cherry picked from commit 139a0931a3ee9808f13e7faecdf9fc4590348f9e)
2024-01-05 09:01:30 -08:00
Sam Lantinga 0fc3574464 Updated copyright for 2024 2024-01-01 13:19:49 -08:00
SDL Wiki Bot 0f8f4f6764 Sync SDL3 wiki -> header
(cherry picked from commit 5df3eac925af8491259032ed275c1ec3e0e8e80b)
2023-12-27 14:49:59 -08:00
Ozkan Sezer ca26cde4e1 SDL_config_os2.h: enable SDL_JOYSTICK_VIRTUAL 2023-12-21 08:55:02 +03:00
Sam Lantinga 7bb0e839a6 Added Steam Input API support for game controllers
Added support for getting the real controller info, as well as the function SDL_GameControllerGetSteamHandle() to get the Steam Input API handle, from the virtual gamepads provided by Steam.

Also added an event SDL_CONTROLLERSTEAMHANDLEUPDATED which is triggered when a controller's API handle changes, e.g. the controllers were reassigned slots in the Steam UI.

(cherry picked from commit c981a597dc7c69e7532796b3a206071807479d35)
2023-12-20 13:29:57 -08:00
Max Maisel e7f03de468 Add steam deck detection and HIDAPI driver scaffold. 2023-12-12 12:52:04 -08:00
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
Ethan Lee 757c984ddb gamecontroller: Backport 3.0 'type:' field to 2.0 2023-11-30 14:42:56 -08:00
shenleban tongying be0e303ec8 document the purpose of SDL_SetTextInputRect
(cherry picked from commit 3e6513c77390969cd870726690bf89e39fe91e60)
2023-11-28 12:11:31 -08: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 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
Cameron Cawley 67eb03400a Add SDL_PIXELFORMAT_INDEX2LSB and SDL_PIXELFORMAT_INDEX2MSB 2023-11-20 15:50:51 -08: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 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 fb92d150d9 Removed unused SDL_OSEvent 2023-11-07 09:15:18 -08:00
Sam Lantinga e8f4045d0b Use XINPUT_STATE instead of XINPUT_STATE_EX (thanks Andrew!)
XINPUT_STATE_EX isn't actually a thing, we can just use the normal XINPUT_STATE

Fixes https://github.com/libsdl-org/SDL/issues/2797
2023-11-04 22:24:55 -07:00
Sam Lantinga 4c2eb6b95d Use the default UCS2/UCS4 conversion rather than non-portable INTERNAL encoding
Fxies https://github.com/libsdl-org/SDL/issues/1497

(cherry picked from commit d07a264a9bc42bd2d92ce12fab55f1855d0e8277)
2023-11-04 12:02:18 -07:00
Ryan C. Gordon 32587bd7de
Sync wiki -> header 2023-10-10 10:19:51 -04:00
Anonymous Maarten a263cc2369 Allow the use of posix_spawn() instead of vfork/execlp()
Backport of #7041

Co-authored-by: elahav <elahav@users.noreply.github.com>
2023-09-30 16:48:51 +02:00
Ryan C. Gordon 25eca09c7e
include: Replaced old Bugzilla URL.
(cherry picked from commit fb137703537411b9aa2206351082b87aba23a843)
2023-09-07 10:53:02 -04:00
Jeremy Demeule aa7ba62978 metal: Add hint to select low power device instead of the default one (#8182)
On some system like MacBook Pro Intel with AMD card, asking for the default device will always return the AMD GPU.
This is not an issue for 99% of the case when the renderer context is here to provide the maximum performance level like for game.
However, for video application using GPU for 1 quad and 1 texture, using the discrete GPU for that lead to an important power consumption (4 to 8W), heat increase, and fan noise.
With this patch, I successfully amend ffplay to only use the integrated GPU (i.e. the Intel one), instead of the discrete GPU (i.e. the AMD one).
2023-08-31 01:55:18 -07:00
Ethan Lee 24fcb61470 – gdk: Add SDL_GDKGetDefaultUser, SDL_GetPrefPath implementation 2023-08-25 10:41:14 -04:00
David CARLIER 4a0f56b679 SDL_TriggerBreakppoint for riscv arch (both 32/64) version.
`ebreak` acts like int3 for x86, giving control of running process to debuggers.
(cherry picked from commit 723bcd0a8be4e816f6555b6bbbd5e9c26ab27137)
2023-08-13 23:02:02 +03:00
Anonymous Maarten 64f17314a2 MSVC has __declspec(deprecated) 2023-08-09 02:53:48 +02:00
Ryan C. Gordon 8087c0a5d2
include: fixed a typo in SDL_RenderGetMetalCommandEncoder docs. 2023-08-06 10:45:11 -04:00
Anonymous Maarten 2b0ca87119 SDL_atomic.h: __ARM_ARCH is not always defined for an arm platform
e.g. riscos toolchain
(cherry picked from commit 8105f1d5b5b83328f4d0017a562674efca821077)
2023-07-26 20:39:20 +03:00
Sam Lantinga a6228e7aaf Added the hint SDL_HINT_JOYSTICK_WGI to control whether to use Windows.Gaming.Input for controllers 2023-07-08 09:34:58 -07:00
Sam Lantinga ceece918e4 Updated to version 2.29.0 for development 2023-06-20 11:50:19 -07:00
Sam Lantinga ffa78e6bea Updated to version 2.28.0 for release 2023-06-20 11:00:20 -07:00
Eric Wasylishen 76392f4fe1 Handle DPI scaling in SDL_GetWindowSurface
Fixes DPI awareness of testdrawchessboard (previously, the surface was
being created in points instead of pixels, resulting in the demo app
only drawing in a corner of the screen on High-DPI displays)

*_CreateWindowFramebuffer()/*_UpdateWindowFramebuffer(): are updated
to use SDL_GetWindowSizeInPixels instead of SDL_GetWindowSize() or
window->w/window->h.

Most of the _CreateWindowFramebuffer backends are untested except
for Windows.

Fixes #7047

(cherry picked from commit 67c91353e01f6f2c0cc80c17eeddbad6def7cb01)
2023-06-14 17:23:54 -07:00
Sam Lantinga d4f9be4416 Updated to version 2.27.1 for release candidate 2023-06-13 19:44:26 -07:00
Sam Lantinga 36033e3832 Make it clear that you can't mix 2D rendering and the window surface API
Also added functions to query and destroy the window surface so you can switch between modes if you want.

See https://github.com/pygame-community/pygame-ce/issues/2190 for more details.
2023-06-10 08:54:36 -07:00
Eddy Jansson 2660da6f5c Always allocate zt in output of SDL_iconv_string()
Before this, the function could not be used on buffers,
as it would not account for the zero-termination unless
it was included in the input.

(cherry picked from commit 5f5abb680523e1adedd3fca2a8e252db01fc1c52)
2023-06-04 05:17:15 -07:00
Alibek Omarov c395240425 hints: clarify support for comma-separated values for QtWayland orientation that's available since 2.0.22
Signed-off-by: Alibek Omarov <a1ba.omarov@gmail.com>
2023-06-02 07:41:08 -07:00
Ozkan Sezer 9dea06f5b5 fix mingw build failures in CI with clang-tidy.
(cherry-picked from commit a8a72de6fbcf9afe8a6e8760f31a79a0ed6fed1a)
2023-05-26 23:55:04 +03:00
Sam Lantinga a2f4783e75 Don't map the top keyboard row to numbers when using the one-handed DVORAK layouts (thanks @tormol!)
Fixes https://github.com/libsdl-org/SDL/pull/5127
2023-05-22 11:30:42 -07:00