src/video/cocoa/SDL_cocoametalview.m
changeset 11809 4b858abfb24d
parent 11797 4da70548aa06
child 11811 5d94cb6b24d3
     1.1 --- a/src/video/cocoa/SDL_cocoametalview.m	Tue Jan 02 19:06:14 2018 -0400
     1.2 +++ b/src/video/cocoa/SDL_cocoametalview.m	Tue Jan 02 21:44:28 2018 -0400
     1.3 @@ -61,11 +61,12 @@
     1.4                     useHighDPI:(bool)useHighDPI
     1.5  {
     1.6  	if ((self = [super initWithFrame:frame])) {
     1.7 -    
     1.8 +        self.wantsLayer = YES;
     1.9 +
    1.10          /* Allow resize. */
    1.11          self.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
    1.12          _tag = METALVIEW_TAG;
    1.13 -      
    1.14 +
    1.15          _useHighDPI = useHighDPI;
    1.16          [self updateDrawableSize];
    1.17  	}
    1.18 @@ -100,8 +101,6 @@
    1.19      SDL_cocoametalview *metalview
    1.20          = [[SDL_cocoametalview alloc] initWithFrame:view.frame
    1.21                         useHighDPI:(window->flags & SDL_WINDOW_ALLOW_HIGHDPI)];
    1.22 -    // Instantiate the CAMetalLayer
    1.23 -    metalview.wantsLayer = YES;
    1.24      [view addSubview:metalview];
    1.25      return metalview;
    1.26  }