mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-08-21 06:10:53 +00:00
iOS: fix SDL_GetUIKitDeviceFormFactor return type
The function returns SDL_FormFactor values but was declared as bool, so iOS devices were misclassified (e.g. tablets as desktop).
This commit is contained in:
committed by
Sam Lantinga
parent
8dc177294b
commit
fcd11827f4
@@ -874,7 +874,7 @@ SDL_FormFactor SDL_GetDeviceFormFactor(void)
|
||||
#elif defined(SDL_PLATFORM_ANDROID)
|
||||
return SDL_GetAndroidDeviceFormFactor();
|
||||
#elif defined(SDL_PLATFORM_IOS)
|
||||
extern bool SDL_GetUIKitDeviceFormFactor(void);
|
||||
extern SDL_FormFactor SDL_GetUIKitDeviceFormFactor(void);
|
||||
return SDL_GetUIKitDeviceFormFactor();
|
||||
#elif defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES) || defined(SDL_PLATFORM_PS2)
|
||||
return SDL_FORMFACTOR_CONSOLE;
|
||||
|
||||
@@ -385,7 +385,7 @@ void SDL_NSLog(const char *prefix, const char *text)
|
||||
* subsystem, but we need to stuff this into an Objective-C source code file.
|
||||
*/
|
||||
|
||||
bool SDL_GetUIKitDeviceFormFactor(void)
|
||||
SDL_FormFactor SDL_GetUIKitDeviceFormFactor(void)
|
||||
{
|
||||
// TODO: Apple Watch
|
||||
switch ([UIDevice currentDevice].userInterfaceIdiom) {
|
||||
|
||||
Reference in New Issue
Block a user