src/video/cocoa/SDL_cocoametalview.m
changeset 11797 4da70548aa06
parent 11507 071deb801690
child 11809 4b858abfb24d
     1.1 --- a/src/video/cocoa/SDL_cocoametalview.m	Sun Dec 31 03:51:17 2017 -0500
     1.2 +++ b/src/video/cocoa/SDL_cocoametalview.m	Sun Dec 31 15:21:25 2017 -0400
     1.3 @@ -28,7 +28,7 @@
     1.4  
     1.5  #import "SDL_cocoametalview.h"
     1.6  
     1.7 -#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_COCOA
     1.8 +#if SDL_VIDEO_DRIVER_COCOA && (SDL_VIDEO_VULKAN || SDL_VIDEO_RENDER_METAL)
     1.9  
    1.10  #include "SDL_assert.h"
    1.11  
    1.12 @@ -44,7 +44,7 @@
    1.13  }
    1.14  
    1.15  /* Indicate the view wants to draw using a backing layer instead of drawRect. */
    1.16 --(BOOL) wantsUpdateLayer
    1.17 +- (BOOL)wantsUpdateLayer
    1.18  {
    1.19      return YES;
    1.20  }
    1.21 @@ -52,7 +52,7 @@
    1.22  /* When the wantsLayer property is set to YES, this method will be invoked to
    1.23   * return a layer instance.
    1.24   */
    1.25 --(CALayer*) makeBackingLayer
    1.26 +- (CALayer*)makeBackingLayer
    1.27  {
    1.28      return [self.class.layerClass layer];
    1.29  }
    1.30 @@ -74,8 +74,9 @@
    1.31  }
    1.32  
    1.33  /* Set the size of the metal drawables when the view is resized. */
    1.34 -- (void)resizeSubviewsWithOldSize:(NSSize)oldSize {
    1.35 -    [super resizeSubviewsWithOldSize:oldSize];
    1.36 +- (void)resizeWithOldSuperviewSize:(NSSize)oldSize
    1.37 +{
    1.38 +    [super resizeWithOldSuperviewSize:oldSize];
    1.39      [self updateDrawableSize];
    1.40  }
    1.41  
    1.42 @@ -123,6 +124,6 @@
    1.43      }
    1.44  }
    1.45  
    1.46 -#endif /* SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_COCOA */
    1.47 +#endif /* SDL_VIDEO_DRIVER_COCOA && (SDL_VIDEO_VULKAN || SDL_VIDEO_RENDER_METAL) */
    1.48  
    1.49  /* vi: set ts=4 sw=4 expandtab: */