Skip to content

Commit fb61736

Browse files
[Rendering] Add native SDL Metal view handling instead of StapleSupport workaround;
1 parent 8867796 commit fb61736

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Engine/Core/Rendering/Windowing/Impls/SDL2RenderWindow.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ private class GamepadState
2727
private bool windowFocused = true;
2828
private bool windowMaximized = false;
2929

30+
private nint metalView = nint.Zero;
31+
3032
public bool ContextLost { get; set; } = false;
3133

3234
public bool IsFocused => windowFocused;
@@ -612,7 +614,12 @@ public nint WindowPointer(AppPlatform platform)
612614

613615
case AppPlatform.MacOSX:
614616

615-
return StapleSupport.MacWindow(info.info.cocoa.window);
617+
if(metalView == nint.Zero)
618+
{
619+
metalView = SDL.SDL_Metal_CreateView(window);
620+
}
621+
622+
return SDL.SDL_Metal_GetLayer(metalView);
616623

617624
default:
618625

0 commit comments

Comments
 (0)