Commit graph

122 commits

Author SHA1 Message Date
Sam Lantinga
c52506c862 Don't build SDL_JOYSTICK_HIDAPI by default on iOS
If you enable this, you'll need to link with CoreBluetooth.framework and add something like this to your Info.plist:
<key>NSBluetoothPeripheralUsageDescription</key>
<string>MyApp would like to remain connected to nearby bluetooth Game Controllers and Game Pads even when you're not using the app.</string>
2018-10-26 09:27:31 -07:00
Ozkan Sezer
0f6d45f840 fix permissions 2018-10-23 09:10:02 +03:00
Sam Lantinga
c47d44bc42 Add exception handling to Android hidapi. 2018-10-22 14:55:42 -07:00
Sam Lantinga
07d64253a1 Fixed bug 4324 - Xcode 10 - more cleanup for macOS and iOS projects
Dominik Reichardt

Xcode warns about
"Traditional headermap style is no longer supported; please migrate to using separate headermaps and set 'ALWAYS_SEARCH_USER_PATHS' to NO."
Just doing the latter is enough to silence the warning without ill effects on compiling. This affects the macOS Xcode projects as well as the iOS projects. Definitely not a bug but an annoying warning that could go away.
2018-10-18 15:41:50 -07:00
Sam Lantinga
0a07b5b836 Fixed bug 4324 - Xcode 10 - more cleanup for macOS and iOS projects
Dominik Reichardt

Similar to bug/patch #4228, the iOS Demo Xcode project needs to add the CoreBluetooth framework.
2018-10-18 15:40:39 -07:00
Ozkan Sezer
0a9f975af7 fix permissions 2018-09-15 08:11:50 +03:00
Sam Lantinga
9f17ce1ed2 Use atomic reference counting for the HID device object 2018-09-14 18:31:01 -07:00
Sam Lantinga
a316223159 Fixed building on tvOS without any sensor support 2018-09-10 22:59:49 -07:00
Ozkan Sezer
5bafa801d0 fix permissions 2018-08-30 12:50:10 +03:00
Sam Lantinga
f69485f745 Added SDL_GetDisplayOrientation() to get the display orientation, and added a new event SDL_DISPLAYEVENT to notify the application when the orientation changes.
Documented the values returned by the accelerometer and gyroscope sensors
2018-08-22 21:48:28 -07:00
Sam Lantinga
e1853645b8 Fixed crash trying to open HIDAPI controller as a haptics device on Windows 2018-08-22 17:44:28 -07:00
Sam Lantinga
b8c45ccb9c Removed dependency on C++ runtime on iOS
--HG--
rename : src/hidapi/ios/hid.mm => src/hidapi/ios/hid.m
2018-08-21 19:42:19 -07:00
Sam Lantinga
da334dae1a Added the iOS sensor implementation 2018-08-21 17:24:12 -07:00
Sam Lantinga
53f72becea Fixed bug 4228 - Clean-up Xcode projects
C.W. Betts

This cleans up the Xcode project by setting the Xcode groups to the corresponding directories. This also removes the Resources folder in OS X's Products group and adds the CoreBluetooth framework to the iOS tests (this is needed due to the addition of hidapi.
2018-08-21 16:47:44 -07:00
Sam Lantinga
db39b4811f Added HIDAPI joystick drivers for more consistent support for Xbox, PS4 and Nintendo Switch Pro controller support across platforms.
Added SDL_GameControllerRumble() and SDL_JoystickRumble() for simple force feedback outside of the SDL haptics API
2018-08-09 16:00:17 -07:00
Ozkan Sezer
53e38a8dfc ran 'chmod -x' on many files 2018-06-12 14:00:15 +03:00
Sam Lantinga
5e85fbd95c Added missing file to tvOS build 2018-02-24 08:40:30 -08:00
Sam Lantinga
46339ac88b Moved deployment target values to project settings 2017-12-12 22:30:21 -08:00
Sam Lantinga
1872077ebd Parameterized the All (target platform) build target scripts so they can be used in other projects 2017-12-12 21:59:39 -08:00
Sam Lantinga
f54dfe1db9 Renamed Xcode build targets so it's easier to copy files out of build directories on the command line
Also enabled bitcode, which is needed for App Store builds
2017-12-12 12:14:55 -08:00
Sam Lantinga
6f4390917e Added SDL_uikitmetalview.m to the tvOS project 2017-12-12 11:29:00 -08:00
Sam Lantinga
259b102bf5 Added the Metal framework to several iOS tests 2017-12-10 09:09:27 -08:00
Sam Lantinga
7e4560664b Fixed building for simulators or older iOS SDKs 2017-12-07 17:47:01 -08:00
Sam Lantinga
40be7cbc97 Fixed compiling Metal renderer on iOS 2017-12-07 17:12:03 -08:00
Sam Lantinga
145d2469ae Updated SDL's YUV support, many thanks to Adrien Descamps
New functions get and set the YUV colorspace conversion mode:
	SDL_SetYUVConversionMode()
	SDL_GetYUVConversionMode()
	SDL_GetYUVConversionModeForResolution()

SDL_ConvertPixels() converts between all supported RGB and YUV formats, with SSE acceleration for converting from planar YUV formats (YV12, NV12, etc) to common RGB/RGBA formats.

Added a new test program, testyuv, to verify correctness and speed of YUV conversion functionality.
2017-11-12 22:51:12 -08:00
Sam Lantinga
876a6b2319 Updated SDL iOS project for tvOS 2017-10-26 10:49:33 -07:00
Sam Lantinga
4d7a2db434 Added functions to query and set the SDL memory allocation functions:
SDL_GetMemoryFunctions()
    SDL_SetMemoryFunctions()
    SDL_GetNumAllocations()
2017-10-12 13:44:28 -07:00
Sam Lantinga
1e46b7fc9a Added stubs for simple Steam Controller support 2017-09-22 08:30:52 -07:00
Sam Lantinga
281e904a4f Fixed bug 3837 - Change project settings for Xcode 9?
Mark Callow

Xcode 9 emits a warning to validate project settings. The changes it proposes are

1. [iOS] Update the iOS deployment target to 8.0 since Xcode does
   not support anything older.

2. [macOS] Target 'Framework' - Automatically Select Archectures.

3. [iOS & macOS] Turns on a bunch more compile warnings, a *lot* more on iOS.

4. [iOS & macOS] Turn on "Missing Localizability".

I want to confirm if it is ok to accept these changes and submit updated project files.

Since Alex Szpakowski has just removed iOS 7 guard ifdef's, I'm guessing 1 isn't a problem.

2 is probably ok for anyone building themselves. I wonder if it may cause problems for building distribution binaries.

3 shouldn't be a problem either provided any newly emitted warnings are fixed.

4 I am unfamiliar with. The description says "This will turn on the static analyzer to check for "Missing Localizability", because this project is localized for multiple languages." I suppose this may cause new warnings.
2017-09-22 12:26:54 -07:00
Sam Lantinga
1a34539bdf The volume was too high, clamp to SDL_MIX_MAXVOLUME 2017-09-22 11:15:57 -07:00
Sam Lantinga
c5b0b2906e Updated iOS keyboard test to cover text input rect and orientation changes 2017-09-14 09:56:16 -07:00
Ryan C. Gordon
a566435db1 vulkan: Initial Vulkan support!
This work was done by Jacob Lifshay and Mark Callow; I'm just merging it
into revision control.

--HG--
extra : rebase_source : cb3bb332146125366b5242c0d7444f44638733d9
extra : amend_source : c72ebb6d3a92efc3fdd085ce3b6d4b1d7f573cc9
2017-08-27 22:15:57 -04:00
Alex Szpakowski
515e98a487 More cleanup of the iOS keyboard demo. 2017-08-15 23:00:54 -03:00
Alex Szpakowski
c396ee0c3b Improve iOS keyboard demo code a bit. 2017-08-15 22:53:57 -03:00
Philipp Wiesemann
ce285c916c ios: Fixed math include in demos. 2017-05-25 23:01:59 +02:00
Philipp Wiesemann
763d2f1efb ios: Fixed compiler warnings about unused variables in demo. 2017-04-09 23:00:26 +02:00
Philipp Wiesemann
03f2036f17 iOS: Fixed compiling template on C89 compilers. 2017-03-19 22:17:01 +01:00
Sam Lantinga
7d8c7416d1 Fixed bug 3517 - Compiler warnings with gcc -Wstrict-prototypes
felix

Compiling even a simple SDL2 'hello world' program with gcc -Wstrict-prototypes (GCC 6.2.1) results in warnings like:

/usr/include/SDL2/SDL_gamecontroller.h:143:1: attention : function declaration isn't a prototype [-Wstrict-prototypes]
 extern DECLSPEC int SDLCALL SDL_GameControllerNumMappings();
 ^~~~~~

It seems there is a missing 'void' between the parentheses.
2016-12-26 02:12:21 -08:00
Ryan C. Gordon
638cb97a63 xcode: Make sure SDL_dataqueue sources are included in all targets. 2016-12-06 13:33:02 -05:00
Ryan C. Gordon
6b6da8150e xcode: updated macOS and iOS project files with SDL_dataqueue sources. 2016-12-06 12:30:31 -05:00
Philipp Wiesemann
de715c79c6 iOS: Updated demo README. 2016-10-09 20:30:49 +02:00
Philipp Wiesemann
0d17b15d91 iOS: Removed unused constant in demo. 2016-09-30 23:31:24 +02:00
Philipp Wiesemann
c6bf0b860a iOS: Updated comment in demo. 2016-09-26 23:09:19 +02:00
Alex Szpakowski
448940e133 Update the code for the iOS demos to handle modern devices. Fixes bug #3337 2016-09-25 00:23:35 -03:00
Alex Szpakowski
a98de9e4f7 CoreAudio iOS/tvOS: Use AVFoundation instead of AudioSession. Fixes audio on tvOS.
Note that linking with AVFoundation is now required if you don't disable SDL_audio compilation on iOS and tvOS.

--HG--
rename : src/audio/coreaudio/SDL_coreaudio.c => src/audio/coreaudio/SDL_coreaudio.m
2016-09-15 19:59:57 -03:00
Sam Lantinga
d3f9978231 Fixed building for both iOS and tvOS on Xcode 8 2016-09-14 08:45:35 -07:00
Sam Lantinga
2cbc2b95ec Allow targeting tvOS 2016-09-14 07:09:35 -07:00
Alex Szpakowski
398a513d09 Initial Apple TV / tvOS support.
The Apple TV remote is currently exposed as a joystick with its touch surface treated as two axes. Key presses are also generated when its buttons and touch surface are used.

A new hint has been added to help deal with deciding whether to background the app when the remote's menu button is pressed: SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS.
2016-09-13 22:18:06 -03:00
Alex Szpakowski
5935e90124 Enable more compiler warnings in the Xcode projects (based on Xcode 8's suggestion), made some integer downcasts explicit. 2016-09-13 19:51:10 -03:00
Ryan C. Gordon
26a75839f4 audio: Removed internal SDL_audiomem.h and macros.
I think this was important for SDL 1.2 because some targets needed
special device memory for DMA buffers or locked memory buffers for use in
hardware interrupts or something, but since it just defines to SDL_malloc
and SDL_free now, I took it out for clarity's sake.

--HG--
extra : histedit_source : 57b48e44e65de9ce4e16604167db325df05bdf98%2C31d881e4d1b5eeba771f04bb43be0d23c3e605ce
2016-08-05 01:44:15 -04:00