The Metal view is a full SDL_uikitview to support multi-touch
authorSam Lantinga <slouken@libsdl.org>
Thu, 07 Dec 2017 09:35:28 -0800
changeset 117282f3ea7f5c671
parent 11727 49f8fb4f6ce2
child 11729 d1ce8396c356
The Metal view is a full SDL_uikitview to support multi-touch
src/video/uikit/SDL_uikitmetalview.h
src/video/uikit/SDL_uikitmetalview.m
     1.1 --- a/src/video/uikit/SDL_uikitmetalview.h	Wed Dec 06 16:37:55 2017 -0500
     1.2 +++ b/src/video/uikit/SDL_uikitmetalview.h	Thu Dec 07 09:35:28 2017 -0800
     1.3 @@ -38,7 +38,7 @@
     1.4  
     1.5  #define METALVIEW_TAG 255
     1.6  
     1.7 -@interface SDL_uikitmetalview : UIView
     1.8 +@interface SDL_uikitmetalview : SDL_uikitview
     1.9  
    1.10  - (instancetype)initWithFrame:(CGRect)frame
    1.11                          scale:(CGFloat)scale
     2.1 --- a/src/video/uikit/SDL_uikitmetalview.m	Wed Dec 06 16:37:55 2017 -0500
     2.2 +++ b/src/video/uikit/SDL_uikitmetalview.m	Thu Dec 07 09:35:28 2017 -0800
     2.3 @@ -49,9 +49,6 @@
     2.4                            tag:(int)tag
     2.5  {
     2.6      if ((self = [super initWithFrame:frame])) {
     2.7 -        /* Resize properly when rotated. */
     2.8 -        self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
     2.9 -
    2.10          /* Set the appropriate scale (for retina display support) */
    2.11          self.contentScaleFactor = scale;
    2.12          self.tag = tag;
    2.13 @@ -105,19 +102,7 @@
    2.14           = [[SDL_uikitmetalview alloc] initWithFrame:view.frame
    2.15                                            scale:scale
    2.16                                              tag:METALVIEW_TAG];
    2.17 -#if 1
    2.18 -    [view addSubview:metalview];
    2.19 -#else
    2.20 -    /* Sets this view as the controller's view, and adds the view to
    2.21 -     * the window hierarchy.
    2.22 -     *
    2.23 -     * Left here for information. Not used because I suspect that for correct
    2.24 -     * operation it will be necesary to copy everything from the window's
    2.25 -     * current SDL_uikitview instance to the SDL_uikitview portion of the
    2.26 -     * SDL_metalview. The latter would be derived from SDL_uikitview rather
    2.27 -     * than UIView. */
    2.28      [metalview setSDLWindow:window];
    2.29 -#endif
    2.30  
    2.31      return metalview;
    2.32  }