mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-22 11:18:14 +00:00
Android: prevent a dummy error message sending SDL_DISPLAYEVENT_ORIENTATION
In the usual case, first call to onNativeOrientationChanged() is done before SDL has been initialised and would just set an error message "Video subsystem has not been initialized" without sending the event.
This commit is contained in:
@@ -583,8 +583,11 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeOrientationChanged)(
|
||||
JNIEnv *env, jclass jcls,
|
||||
jint orientation)
|
||||
{
|
||||
SDL_VideoDisplay *display = SDL_GetDisplay(0);
|
||||
SDL_SendDisplayEvent(display, SDL_DISPLAYEVENT_ORIENTATION, orientation);
|
||||
SDL_VideoDevice *_this = SDL_GetVideoDevice();
|
||||
if (_this) {
|
||||
SDL_VideoDisplay *display = SDL_GetDisplay(0);
|
||||
SDL_SendDisplayEvent(display, SDL_DISPLAYEVENT_ORIENTATION, orientation);
|
||||
}
|
||||
}
|
||||
|
||||
/* Paddown */
|
||||
|
Reference in New Issue
Block a user