[Commits] SDL: The Metal view is a full SDL_uikitview to support multi-touch

libsdl.org revision control commits-owner at libsdl.org
Thu Dec 7 09:35:31 PST 2017


details:   https://hg.libsdl.org/SDL/rev/2f3ea7f5c671
changeset: 11728:2f3ea7f5c671
user:      Sam Lantinga <slouken at libsdl.org>
date:      Thu Dec 07 09:35:28 2017 -0800
description:
The Metal view is a full SDL_uikitview to support multi-touch

diffstat:

 src/video/uikit/SDL_uikitmetalview.h |   2 +-
 src/video/uikit/SDL_uikitmetalview.m |  15 ---------------
 2 files changed, 1 insertions(+), 16 deletions(-)

diffs (45 lines):

diff -r 49f8fb4f6ce2 -r 2f3ea7f5c671 src/video/uikit/SDL_uikitmetalview.h
--- a/src/video/uikit/SDL_uikitmetalview.h	Wed Dec 06 16:37:55 2017 -0500
+++ b/src/video/uikit/SDL_uikitmetalview.h	Thu Dec 07 09:35:28 2017 -0800
@@ -38,7 +38,7 @@
 
 #define METALVIEW_TAG 255
 
- at interface SDL_uikitmetalview : UIView
+ at interface SDL_uikitmetalview : SDL_uikitview
 
 - (instancetype)initWithFrame:(CGRect)frame
                         scale:(CGFloat)scale
diff -r 49f8fb4f6ce2 -r 2f3ea7f5c671 src/video/uikit/SDL_uikitmetalview.m
--- a/src/video/uikit/SDL_uikitmetalview.m	Wed Dec 06 16:37:55 2017 -0500
+++ b/src/video/uikit/SDL_uikitmetalview.m	Thu Dec 07 09:35:28 2017 -0800
@@ -49,9 +49,6 @@
                           tag:(int)tag
 {
     if ((self = [super initWithFrame:frame])) {
-        /* Resize properly when rotated. */
-        self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-
         /* Set the appropriate scale (for retina display support) */
         self.contentScaleFactor = scale;
         self.tag = tag;
@@ -105,19 +102,7 @@
          = [[SDL_uikitmetalview alloc] initWithFrame:view.frame
                                           scale:scale
                                             tag:METALVIEW_TAG];
-#if 1
-    [view addSubview:metalview];
-#else
-    /* Sets this view as the controller's view, and adds the view to
-     * the window hierarchy.
-     *
-     * Left here for information. Not used because I suspect that for correct
-     * operation it will be necesary to copy everything from the window's
-     * current SDL_uikitview instance to the SDL_uikitview portion of the
-     * SDL_metalview. The latter would be derived from SDL_uikitview rather
-     * than UIView. */
     [metalview setSDLWindow:window];
-#endif
 
     return metalview;
 }


More information about the commits mailing list