Commit Graph

299 Commits

Author SHA1 Message Date
Alex Szpakowski
b669a6546f iOS: Don't ignore the requested alpha bit size when determining whether to use an RGBA8 backbuffer. 2018-10-14 17:26:10 -03:00
Alex Szpakowski
c13bc99b59 metal: Fix high dpi and resizing on macOS, and clean up iOS code. Fixes bug #4250. 2018-10-12 17:55:42 -03:00
Sam Lantinga
85b2a541a6 Fixed whitespace 2018-09-24 11:49:25 -07:00
Sam Lantinga
f4a9580326 Fixed Chinese IME support (thanks 树子。!) 2018-09-10 23:01:33 -07:00
Sam Lantinga
aa37b0e028 Fixed building on tvOS 2018-09-10 23:00:09 -07:00
Sam Lantinga
de6d77b437 Moved display orientation handling on iOS out to a separate function for Qt apps 2018-08-22 23:47:29 -07:00
Sam Lantinga
2d69f1cbf5 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
9505b76b0d Moved SDL_IsTablet() to a cross-platform API function 2018-08-21 20:03:54 -07:00
Sam Lantinga
ce26218414 Add SDL_IsTablet() to Android and iOS SDL. 2018-08-21 11:23:47 -07:00
Ryan C. Gordon
a73391c70f metal: contrary to documentation, we need to set the drawableSize explicitly.
Fixes Bugzilla #4149.
2018-05-27 20:30:03 -04:00
Sam Lantinga
b0cf4d715a Merged latest changes from Steam Link app 2018-05-18 13:09:30 -07:00
Sam Lantinga
f57d19612d Fixed setting the layer drawable size
Without this change the drawable had a size of 0 and the metal renderer asserted because the projection matrix wasn't set.
2018-03-02 12:08:18 -08:00
Mark Callow
220ef7f3b9 Fix high-dpi support on macOS and simplify it and iOS variant.
The detault drawableSize for a CAMetalLayer is its bounds x its scale.
So it is sufficient to set the *layer's* scale to the desired value.
2018-02-21 09:58:21 -08:00
sezero
7287068da5 revert the recent typecast assignment changes (see bug #4079)
also change the void* typedefs for the two vulkan function
pointers added in vulkan_internal.h  into generic function
pointer typedefs.
2018-02-12 17:00:00 +03:00
Sam Lantinga
326b4ae577 Send Apple TV remote input as key events unless it's opened as a joystick, to match Android behavior. 2018-02-06 16:43:31 -08:00
Sam Lantinga
5537585efa Replaced SDL_HINT_APPLE_TV_REMOTE_SWIPES_AS_ARROW_KEYS with SDL_HINT_TV_REMOTE_AS_JOYSTICK which controls whether remotes on iOS and Android are interpreted as joysticks (the default) or as return/escape/arrow keys. 2018-02-06 15:03:38 -08:00
Sam Lantinga
127e43ed2d Fixed building on tvOS 2018-02-01 15:46:51 -08:00
Sam Lantinga
992ad33eaf Added SDL_HINT_IOS_HIDE_HOME_INDICATOR to determine how the home indicator on the iPhone X is handled.
This variable can be set to the following values:
   "0"       - The indicator bar is not hidden (default for windowed applications)
   "1"       - The indicator bar is hidden and is shown when the screen is touched (useful for movie playback applications)
   "2"       - The indicator bar is dim and the first swipe makes it visible and the second swipe performs the "home" action (default for fullscreen applications)
2018-02-01 15:21:01 -08:00
Sam Lantinga
49ae998d51 Fixed ISO C99 compatibility
SDL now builds with gcc 7.2 with the following command line options:
-Wall -pedantic-errors -Wno-deprecated-declarations -Wno-overlength-strings --std=c99
2018-01-30 18:08:34 -08:00
Sam Lantinga
03f8b2992b Added a hint SDL_HINT_APPLE_TV_REMOTE_SWIPES_AS_ARROW_KEYS to prevent turning Apple TV remote swipes into arrow key events 2018-01-17 17:24:15 -08:00
Sam Lantinga
a9072159b2 Updated copyright for 2018 2018-01-03 10:03:25 -08:00
Sam Lantinga
ef7a48c03e Fixed bug 4004 - iOS: don't hide keyboard on RETURN
Dominik Reichardt

As discussed in 2012 the iOS onscreen keyboard hides when you hit RETURN (see https://discourse.libsdl.org/t/on-screen-keyboard-change/19216).
IMO this is a bad idea to not be able to influence this behavior and just recently this was fixed for Android by adding the hint SDL_HINT_ANDROID_RETURN_HIDES_IME in changeset 11768	0f2fb9ec6ad6.
2017-12-19 10:57:21 -08:00
Sam Lantinga
ef2b2d41c1 Fixed compiler warning 2017-12-08 11:33:27 -08:00
Sam Lantinga
31404706b5 Fixed building for simulators or older iOS SDKs 2017-12-07 17:47:01 -08:00
Sam Lantinga
c6972eecc2 Fixed compiling Metal renderer on iOS 2017-12-07 17:12:03 -08:00
Sam Lantinga
2505a8a1a7 The Metal view is a full SDL_uikitview to support multi-touch 2017-12-07 09:35:28 -08:00
Alex Szpakowski
206db431ec iOS MoltenVK code style cleanup. 2017-09-21 20:30:25 -03:00
Sam Lantinga
2859e2ca8b Reverted Alex's commit 4f3f29b6b666 - we're about to release 2.0.6, don't remove support for the iOS 7 SDK yet. 2017-09-20 19:59:34 -07:00
Alex Szpakowski
95cdaf7350 iOS: I don't think SDL compiles with the iOS 7 SDK anymore, so we might as well drop the #ifdefs trying to guard for that. 2017-09-20 11:01:32 -03:00
Alex Szpakowski
590f16b713 iOS: remove an unused static variable 2017-09-20 10:53:41 -03:00
Sam Lantinga
f37e3f7f4b Fixed iOS keyboard positioning, based on the final position rather than the initial one 2017-09-14 09:55:27 -07:00
Alex Szpakowski
1d02ce7601 Code style cleanup in the Cocoa and UIKit vulkan files. 2017-08-31 21:26:13 -03:00
Sam Lantinga
6224870504 Fixed mingw Windows build, since SDL_vulkan_internal.h includes windows.h 2017-08-28 00:43:14 -07:00
Sam Lantinga
7bb3adf896 Renaming of guard header names to quiet -Wreserved-id-macro 2017-08-28 00:22:23 -07:00
Sam Lantinga
ae48232ed1 Be clear that disabling Vulkan surface support disables the entire SDL Vulkan integration 2017-08-28 00:11:38 -07:00
Ryan C. Gordon
10d552ae31 vulkan: Initial Vulkan support!
This work was done by Jacob Lifshay and Mark Callow; I'm just merging it
into revision control.
2017-08-27 22:15:57 -04:00
Alex Szpakowski
0f0ad62237 iOS 10: Work around screen bounds orientation bug. Fixes bugs #3465 and #3505. 2017-08-18 23:23:30 -03:00
Alex Szpakowski
86ed4c9ebb Improve iOS keyboard demo code a bit. 2017-08-15 22:53:57 -03:00
Sam Lantinga
57143a1183 Fixed bug 3745 - specify SDLCALL as the calling convention for API callbacks
Patches contributed by Ozkan Sezer
2017-08-14 06:28:21 -07:00
Alex Szpakowski
95bad6f5c2 iOS: Fix app orientation when creating a landscape fullscreen window with the device currently in portrait orientation. 2017-08-12 22:16:04 -03:00
Alex Szpakowski
74309da16b iOS: Use modern replacements for deprecated functions, when available. 2017-07-15 17:41:58 -03:00
Alex Szpakowski
ce6b0c64a1 Expose display refresh rate on iOS/tvOS 10.3+. 2017-06-10 21:29:37 -03:00
Sam Lantinga
caa97b2b72 Added support for mixing Qt and SDL on iOS
You should call SDL_SetMainReady(), and then customize the QIOSApplicationDelegate like this, in your application code:

/* Additional support for applications mixing Qt and SDL */
@interface QIOSApplicationDelegate : UIResponder <UIApplicationDelegate>
@end

extern "C"
{
void SDL_OnApplicationWillResignActive();
void SDL_OnApplicationDidEnterBackground();
void SDL_OnApplicationWillEnterForeground();
void SDL_OnApplicationDidBecomeActive();
}

@interface QIOSApplicationDelegate (SDL)

- (void)applicationWillResignActive:(UIApplication*)application;
- (void)applicationDidEnterBackground:(UIApplication*)application;
- (void)applicationWillEnterForeground:(UIApplication*)application;
- (void)applicationDidBecomeActive:(UIApplication*)application;

@end

@implementation QIOSApplicationDelegate (SDL)

- (void)applicationWillResignActive:(UIApplication*)application
{
    SDL_OnApplicationWillResignActive();
}

- (void)applicationDidEnterBackground:(UIApplication*)application
{
    SDL_OnApplicationDidEnterBackground();
}

- (void)applicationWillEnterForeground:(UIApplication*)application
{
    SDL_OnApplicationWillEnterForeground();
}

- (void)applicationDidBecomeActive:(UIApplication*)application
{
    SDL_OnApplicationDidBecomeActive();
}

@end // QIOSApplicationDelegate
2017-05-09 10:10:42 -07:00
Philipp Wiesemann
63db7e414d Removed newlines from error messages. 2017-03-26 21:00:19 +02:00
Sam Lantinga
d77ab77a7a Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Sam Lantinga
7f0b81eebd 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
Alex Szpakowski
7ad6cbc42a tvOS: Expose remote swipe gestures as arrow key presses (thanks oviano!) 2016-12-18 13:05:14 -04:00
Alex Szpakowski
2bfa2037ca iOS bug #3377: work around bugs in some third party iOS libraries (e.g. Google admob) where they assume the optional UIApplicationDelegate ‘window’ property always exists and will crash if it doesn’t. 2016-12-18 12:28:28 -04:00
Sam Lantinga
b505909719 Fixed bug 3513 - SDL_GL_SwapWindow does not return error status
Return an error code from SDL_GL_SwapWindow(), like the other SDL APIs.
2016-12-09 01:47:43 -08:00
Sam Lantinga
d0ad2d6288 Fixed bug 3305 - Fixed TextInput status when the keyboard was dismissed with the dismiss key on the iPad
Diego

I was previously unaware that rotating the device to a different orientation when the keyboard is shown causes a keyboardWillHide followed by a keyboardWillShow notification. The previous patch would then mistakenly StopTextInput when rotating. This patch fixes that by checking if the device is rotating before stopping text input.
2016-12-02 02:21:35 -08:00