Commit Graph

859 Commits (014f507c4007436c6063e9f3590e6bca834e3ec0)

Author SHA1 Message Date
Sam Lantinga 393c8c1f16 Fixed bug 5440 - MacCatalyst build failures
C.W. Betts

I tested building commit http://hg.libsdl.org/SDL/rev/7adf3fdc19f3 on Mac Catalyst and found some issues:

* MTLFeatureSet_iOS_* enums aren't available under Mac Catalyst.
* OpenGL ES is unavailable under Mac Catalyst.
* Some Metal features are available under Catalyst but not iOS, such as displaySyncEnabled.
* Set Metal as the default renderer on Mac Catalyst

Attaching a patch that will make SDL2 build for Mac Catalyst.
2021-01-03 10:32:55 -08:00
Cameron Gutman 115d66e756 Use MSVC _byteswap intrinsics for SDL byteswapping functions
This generates bswap on x86/x64 and rev on ARM
2021-01-02 12:50:01 -06:00
Cameron Gutman 6cbd4417f0 Add a hint for D3D9Ex to avoid having to choose at compile-time 2021-01-02 14:45:15 -06:00
Sam Lantinga 6f9e18da2a Fixed bug 5441 - Add support for endianness check on FreeBSD: Fixes endianness checking on at least powerpc64le, maybe also other architectures
VVD

Patch based on patch from FreeBSD port devel/sdl20:
https://svnweb.freebsd.org/ports/head/devel/sdl20/files/patch-include_SDL__endian.h?view=log
2021-01-03 10:18:39 -08:00
Sam Lantinga 9130f7c377 Updated copyright for 2021 2021-01-02 10:25:38 -08:00
Sam Lantinga 223af86c62 Added SDL_RenderGetD3D11Device() to get access to the device associated with the D3D11 renderer 2021-01-01 11:12:30 -08:00
Ozkan Sezer 5b2e011e6d SDL_endian.h: minor fixes from SDL-1.2 branch
( forward-port of changesets 3909:6832b00d3594 and 5657:529d23724144 )
2020-12-30 23:55:02 +03:00
Ozkan Sezer 92edee2324 SDL_config_android.h: update SIZEOF_VOIDP define to respect __LP64__ 2020-12-30 01:28:02 +03:00
Ozkan Sezer 7c105f12d5 updates to SDL_config_os2.h 2020-12-30 01:21:10 +03:00
Ozkan Sezer 1cdc1d4890 SDL_config.h.cmake, SDL_config.h.in: update for SIZEOF_VOIDP define 2020-12-30 01:00:24 +03:00
Ozkan Sezer 9fc139dfb5 SDL_config_windows.h: add missing HAVE_STRTOULL along side HAVE_STRTOLL 2020-12-30 01:00:24 +03:00
Ozkan Sezer b76b81b0e4 SDL_config.h.cmake, SDL_config.h.in: add os/2 driver defines
in case autofoo or cmake is used for it some day..
2020-12-30 01:00:24 +03:00
Ozkan Sezer 8a32ee24db removed MSVC strtok_s use from SDL_strtokr().
no other ??_s are used elsewhere in SDL_stdinc. besides, C11 has a
strtok_s with a different signature.
2020-12-30 01:00:24 +03:00
Sam Lantinga 0684572ccc Added a hint to control whether the player LEDs should be lit to indicate which player is associated with a PS5 controller. 2020-12-29 12:13:10 -08:00
Joel Linn 8fc0baad98 Add SDL_cond implementation using Windows Condition Variables
Is automatically used when the SRW SDL_mutex implementation is active.
Otherwise falls back to the generic implementation.

v2: - Rebase onto master fa3ea1051a4b
2020-12-28 11:43:11 -08:00
Joel Linn 2443e51e0e Add optional suffix `_generic` to generic SDL_cond impl
Allows for runtime selectable implementation
2020-12-28 11:42:49 -08:00
Ozkan Sezer 9e22f62e0d arm64 implementations of SDL_Swap16/32 (bug #5419.)
patch from David Carlier.
2020-12-28 11:50:02 +03:00
Ozkan Sezer 2355dea448 revert 'arm64 implementations of SDL_Swap16/32' for now (bug #5419) 2020-12-28 08:00:50 +03:00
Ozkan Sezer 2f99bc07e7 arm64 implementations of SDL_Swap16/32 (bug #5419.)
patch from David Carlier.
2020-12-28 07:20:20 +03:00
Sam Lantinga 93ccdee8c1 Fixed bug 5404 - stdlib: Added SDL_round, SDL_roundf, SDL_lround and SDL_lroundf
Cameron Cawley

stdlib: Added SDL_round, SDL_roundf, SDL_lround and SDL_lroundf

The default implementation is based on the one used in the Windows RT video driver.
2020-12-23 13:47:49 -08:00
Joel Linn d0b8295c0d Add SDL_sem implementation using Atomics and WaitOnAddress API.
Keep Semaphore Kernel Object impl for Windows 7 and older - choose at runtime

v2: - Fix mixed int/LONG types
    - Reorder definitions
    - Add missing include

v3: - Use `GetModuleHandle()` to load the API Set
2020-12-23 13:36:46 -08:00
Joel Linn 548cb90893 Add SDL_mutex implementation using Windows Slim Reader/Writer Locks Keep Critical Section impl for Windows XP/Vista - choose at runtime
v2: - Add SRW definitions as suggested by Ozkan Sezer
      Allows building against older platform headers.
    - Rename "hidden" function parameter `mutex_` to `_mutex`

v3: - Use GetModuleHandle instead of LoadLibrary
    - Fix typo in comment
2020-12-23 13:33:36 -08:00
Sylvain Becker ae8a270f61 Add SDL_SoftStretchLowerLinear() (Bug 5313) 2020-12-23 21:37:40 +01:00
Sam Lantinga 4ec776c334 Don't switch the PS5 controller out of DirectInput mode by default 2020-12-22 13:29:23 -08:00
Sam Lantinga 350f1b0d16 Updated SDL to version 2.0.15 for development 2020-12-22 10:36:15 -08:00
Sam Lantinga 5f7cd1fa88 Added hints to control whether SDL updates joystick and sensor state in the main event loop 2020-12-18 10:08:59 -08:00
Sam Lantinga 6bd4c717a1 Fixed bug 5402 - ARM support little update proposal
David Carlier

No fix but mostly an update for ARM architecture.
2020-12-17 21:41:23 -08:00
Ozkan Sezer b6e63625c8 fix bug #5395: handle old systems where inotify_init1 is not available 2020-12-13 15:32:24 +03:00
Sam Lantinga ce7c751c2c Document that the joystick deadzone hint defaults off 2020-12-12 23:54:40 -08:00
Sam Lantinga 13a4caf1d7 Fixed bug 4286 - Joystick subsystem causes "not responding" when app is in the background
Added a hint to control whether a separate thread should be used for joystick events.
This is off by default because dispatching messages in other threads appears to cause problems on some versions of Windows.
2020-12-12 22:08:02 -08:00
Ozkan Sezer bca9decbda fix bug #5394 - define _DARWIN_C_SOURCE only if not already defined 2020-12-12 23:28:10 +03:00
Sam Lantinga 7fa5e95b62 Fixed bug 5213 - Add support to metal in iOS/tvOS simulator
Vincent Hamm

Xcode11 and ios13 added support for metal simulator.
Here is a quick and dirty patch to enable it. Pretty early and only tested on a few samples for now. Required mostly to enable metal support on correct version of ios, generate simulator compatible shaders and enforce buffer alignments on simulator (same as osx).
2020-12-09 07:23:47 -08:00
Ozkan Sezer 250a055727 fix bug #5384 -- define DLL_EXPORT in DLL builds and adjust begin_code.h 2020-12-09 12:01:10 +03:00
Sam Lantinga a2098a47b6 Updated SDL to 2.0.14 in preparation for release candidate 2020-12-08 18:56:06 -08:00
Mikhail Paulyshka 146d9b8201 win32: fix symbols leakage for static libraries 2017-09-24 14:32:30 +03:00
Sam Lantinga 7f1c6e82b9 Accepted patch https://github.com/microsoft/vcpkg/blob/master/ports/sdl2/enable-winrt-cmake.patch 2020-12-08 09:13:08 -08:00
Sam Lantinga 7854f43b6d Disable SDL_JOYSTICK_HIDAPI on iOS and tvOS by default
It's only needed for Steam Controller support, and introduces a Bluetooth framework dependency which requires additional permissions on the App Store.
2020-12-01 14:43:15 -08:00
Sam Lantinga a0c5bfa3bd Moved raw input event processing from the main thread to the joystick thread
This allows fast joystick event delivery regardless of what the main thread is doing.
2020-11-27 13:08:40 -08:00
Sam Lantinga 845b903324 Implemented trigger rumble for raw input controllers 2020-11-25 16:46:42 -08:00
Ozkan Sezer e5783e1179 cmake: add missing checks for wcscasecmp, _wcsicmp, wcsncasecmp, _wcsnicmp 2020-11-25 14:51:56 +03:00
Ozkan Sezer 7c18088f00 SDL_config_os2.h: define HAVE__WCSICMP and HAVE__WCSNICMP 2020-11-25 14:51:56 +03:00
Sam Lantinga 46a844786b Added SDL_wcscasecmp() and SDL_wcsncasecmp() 2020-11-24 12:43:01 -08:00
Sam Lantinga c63bbb06e9 Including SDL_config_iphoneos.h enables MFI controller code 2020-11-24 06:55:33 -08:00
Sam Lantinga 1e943e2ad2 Fixed building with an older SDK and macOS target 2020-11-23 22:59:22 -08:00
Sam Lantinga 1fc5ca6484 Fixed building with an older SDK and macOS target 2020-11-23 22:24:54 -08:00
Sam Lantinga e9869e07bf Fixed bug 5335 - enable joystick/haptic/evdev support by default on FreeBSD
Alex S

Evdev headers aren't actually included in the base system (well, it has a private copy), they are available through the devel/evdev-proto port instead. We also have devel/libinotify and devel/libudev-devd shims, I didn't verify whether they work with SDL.
2020-11-23 21:08:19 -08:00
Sam Lantinga 38ab8bf74b Fixed bug 5362 - Mac OS ARM doesn't build Metal/Vulkan back-end/renderers
C.W. Betts

As it is, SDL2's built-in config on macOS for Metal excludes Apple Silicon. This is due to thinking that the 64-bit Mac platform would always be x86_64. My patch fixes this by using the catch-all of 64-bit platforms.
2020-11-23 21:03:43 -08:00
Sam Lantinga 62e39b5fa7 Fixed building with an older SDK and macOS target 2020-11-23 20:57:14 -08:00
Ozkan Sezer 4c96faee57 remove non-existing tslib support from autofoo and cmake 2020-11-23 20:37:10 +03:00
Sam Lantinga fd89446782 Fixed building on Mac OS X on the command line and with an older macOS SDK 2020-11-21 14:13:26 -08:00