src/video/uikit/SDL_uikitwindow.m
changeset 5527 9a03d2300486
parent 5523 6dc03727fadc
child 5529 8c0d15077360
equal deleted inserted replaced
5526:5645b3a5dc03 5527:9a03d2300486
    53 - (void)loadView  {
    53 - (void)loadView  {
    54     // do nothing.
    54     // do nothing.
    55 }
    55 }
    56 
    56 
    57 // Send a resized event when the orientation changes.
    57 // Send a resized event when the orientation changes.
    58 - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
    58 - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
       
    59     const UIInterfaceOrientation toInterfaceOrientation = [self interfaceOrientation];
    59     SDL_WindowData *data = self->window->driverdata;
    60     SDL_WindowData *data = self->window->driverdata;
    60     UIWindow *uiwindow = data->uiwindow;
    61     UIWindow *uiwindow = data->uiwindow;
    61     CGRect frame = [uiwindow frame];
    62     CGRect frame = [uiwindow frame];
    62     const CGSize size = frame.size;
    63     const CGSize size = frame.size;
    63     int w, h;
    64     int w, h;
    77 
    78 
    78         default:
    79         default:
    79             SDL_assert(0 && "Unexpected interface orientation!");
    80             SDL_assert(0 && "Unexpected interface orientation!");
    80             return;
    81             return;
    81     }
    82     }
       
    83 
    82     frame.size.width = w;
    84     frame.size.width = w;
    83     frame.size.height = h;
    85     frame.size.height = h;
       
    86     [uiwindow setFrame:frame];
       
    87     [data->view updateFrame];
    84     SDL_SendWindowEvent(self->window, SDL_WINDOWEVENT_RESIZED, w, h);
    88     SDL_SendWindowEvent(self->window, SDL_WINDOWEVENT_RESIZED, w, h);
    85 }
    89 }
    86 
    90 
    87 @end
    91 @end
    88 
    92