Commits

David Rogers  committed ae508ed Merge

Merge v1-8

  • Participants
  • Parent commits 0a550b3, 532e3db
  • Branches v1-9

Comments (0)

Files changed (2)

File RenderSystems/GLES/src/EAGL/OgreEAGLView.mm

     if(!UIDeviceOrientationIsValidInterfaceOrientation(deviceOrientation))
         return;
 
+    // Check if orientation is supported
+    NSString *rotateToOrientation = @"";
+    if(deviceOrientation == UIInterfaceOrientationPortrait)
+        rotateToOrientation = @"UIInterfaceOrientationPortrait";
+    else if(deviceOrientation == UIInterfaceOrientationPortraitUpsideDown)
+        rotateToOrientation = @"UIInterfaceOrientationPortraitUpsideDown";
+    else if(deviceOrientation == UIInterfaceOrientationLandscapeLeft)
+        rotateToOrientation = @"UIInterfaceOrientationLandscapeLeft";
+    else if(deviceOrientation == UIInterfaceOrientationLandscapeRight)
+        rotateToOrientation = @"UIInterfaceOrientationLandscapeRight";
+
+    NSArray *supportedOrientations = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UISupportedInterfaceOrientations"];
+
+    BOOL supported = [supportedOrientations containsObject:rotateToOrientation];
+
+    if (!supported)
+        return;
+
     // Get the window using the name that we saved
     RenderWindow *window = static_cast<RenderWindow *>(Root::getSingleton().getRenderSystem()->getRenderTarget(mWindowName));
 

File RenderSystems/GLES2/src/EAGL/OgreEAGL2View.mm

     if(!UIDeviceOrientationIsValidInterfaceOrientation(deviceOrientation))
         return;
 
+    // Check if orientation is supported
+    NSString *rotateToOrientation = @"";
+    if(deviceOrientation == UIInterfaceOrientationPortrait)
+        rotateToOrientation = @"UIInterfaceOrientationPortrait";
+    else if(deviceOrientation == UIInterfaceOrientationPortraitUpsideDown)
+        rotateToOrientation = @"UIInterfaceOrientationPortraitUpsideDown";
+    else if(deviceOrientation == UIInterfaceOrientationLandscapeLeft)
+        rotateToOrientation = @"UIInterfaceOrientationLandscapeLeft";
+    else if(deviceOrientation == UIInterfaceOrientationLandscapeRight)
+        rotateToOrientation = @"UIInterfaceOrientationLandscapeRight";
+
+    NSArray *supportedOrientations = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UISupportedInterfaceOrientations"];
+
+    BOOL supported = [supportedOrientations containsObject:rotateToOrientation];
+
+    if (!supported)
+        return;
+
     // Get the window using the name that we saved
     RenderWindow *window = static_cast<RenderWindow *>(Root::getSingleton().getRenderSystem()->getRenderTarget(mWindowName));