mirror of
https://github.com/encounter/SDL.git
synced 2025-12-08 13:15:10 +00:00
Added initial support for MFi game controllers on iOS.
This commit is contained in:
@@ -25,8 +25,8 @@
|
||||
#ifndef SDL_JOYSTICK_DISABLED
|
||||
|
||||
#ifdef __IPHONEOS__
|
||||
#define SCREEN_WIDTH 320
|
||||
#define SCREEN_HEIGHT 480
|
||||
#define SCREEN_WIDTH 480
|
||||
#define SCREEN_HEIGHT 320
|
||||
#else
|
||||
#define SCREEN_WIDTH 512
|
||||
#define SCREEN_HEIGHT 317
|
||||
|
||||
@@ -243,6 +243,8 @@ main(int argc, char *argv[])
|
||||
int i;
|
||||
SDL_Joystick *joystick;
|
||||
|
||||
SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0");
|
||||
|
||||
/* Enable standard application logging */
|
||||
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
|
||||
|
||||
@@ -275,7 +277,7 @@ main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#if defined(__ANDROID__) || defined(__IPHONEOS__)
|
||||
if (SDL_NumJoysticks() > 0) {
|
||||
#else
|
||||
if (argv[1]) {
|
||||
@@ -284,7 +286,7 @@ main(int argc, char *argv[])
|
||||
SDL_bool keepGoing = SDL_TRUE;
|
||||
SDL_Event event;
|
||||
int device;
|
||||
#ifdef __ANDROID__
|
||||
#if defined(__ANDROID__) || defined(__IPHONEOS__)
|
||||
device = 0;
|
||||
#else
|
||||
device = atoi(argv[1]);
|
||||
|
||||
Reference in New Issue
Block a user