src/core/android/SDL_android.c
changeset 12150 f958f3c2e006
parent 12137 161f67f4a7c6
child 12152 cb129c06aa86
     1.1 --- a/src/core/android/SDL_android.c	Thu Aug 23 14:32:30 2018 -0400
     1.2 +++ b/src/core/android/SDL_android.c	Thu Aug 23 14:05:25 2018 -0700
     1.3 @@ -135,6 +135,10 @@
     1.4  JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeEnvironmentVariablesSet)(
     1.5          JNIEnv* env, jclass cls);
     1.6  
     1.7 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeOrientationChanged)(
     1.8 +        JNIEnv* env, jclass cls,
     1.9 +        jint orientation);
    1.10 +
    1.11  /* Java class SDLInputConnection */
    1.12  JNIEXPORT void JNICALL SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeCommitText)(
    1.13          JNIEnv* env, jclass cls,
    1.14 @@ -535,6 +539,14 @@
    1.15      Android_SetScreenResolution(surfaceWidth, surfaceHeight, deviceWidth, deviceHeight, format, rate);
    1.16  }
    1.17  
    1.18 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeOrientationChanged)(
    1.19 +                                    JNIEnv *env, jclass jcls,
    1.20 +                                    jint orientation)
    1.21 +{
    1.22 +    SDL_VideoDisplay *display = SDL_GetDisplay(0);
    1.23 +    SDL_SendDisplayEvent(display, SDL_DISPLAYEVENT_ORIENTATION, orientation);
    1.24 +}
    1.25 +
    1.26  /* Paddown */
    1.27  JNIEXPORT jint JNICALL SDL_JAVA_CONTROLLER_INTERFACE(onNativePadDown)(
    1.28                                      JNIEnv* env, jclass jcls,