mirror of https://github.com/encounter/SDL.git
Android: check SDL is initialized before sending the event
Avoid error message: SDLActivity thread ends (error=Video subsystem has not been initialized)
This commit is contained in:
parent
82758efc46
commit
063c0c2a73
|
@ -741,7 +741,12 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeOrientationChanged)(
|
||||||
SDL_LockMutex(Android_ActivityMutex);
|
SDL_LockMutex(Android_ActivityMutex);
|
||||||
|
|
||||||
displayOrientation = (SDL_DisplayOrientation)orientation;
|
displayOrientation = (SDL_DisplayOrientation)orientation;
|
||||||
SDL_SendDisplayEvent(SDL_GetDisplay(0), SDL_DISPLAYEVENT_ORIENTATION, orientation);
|
|
||||||
|
if (Android_Window)
|
||||||
|
{
|
||||||
|
SDL_VideoDisplay *display = SDL_GetDisplay(0);
|
||||||
|
SDL_SendDisplayEvent(display, SDL_DISPLAYEVENT_ORIENTATION, orientation);
|
||||||
|
}
|
||||||
|
|
||||||
SDL_UnlockMutex(Android_ActivityMutex);
|
SDL_UnlockMutex(Android_ActivityMutex);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue