This is not a continuation of the Metal backend; this is simply bringing the branch up to date and merging it as-is behind an experiment. --------- Co-authored-by: Isaac Marovitz <isaacryu@icloud.com> Co-authored-by: Samuliak <samuliak77@gmail.com> Co-authored-by: SamoZ256 <96914946+SamoZ256@users.noreply.github.com> Co-authored-by: Isaac Marovitz <42140194+IsaacMarovitz@users.noreply.github.com> Co-authored-by: riperiperi <rhy3756547@hotmail.com> Co-authored-by: Gabriel A <gab.dark.100@gmail.com>
48 lines
1.4 KiB
C#
48 lines
1.4 KiB
C#
using Ryujinx.Common.Configuration;
|
|
using Ryujinx.Input.HLE;
|
|
using Ryujinx.SDL2.Common;
|
|
using SharpMetal.QuartzCore;
|
|
using System.Runtime.Versioning;
|
|
using static SDL2.SDL;
|
|
|
|
namespace Ryujinx.Headless.SDL2.Metal
|
|
{
|
|
[SupportedOSPlatform("macos")]
|
|
class MetalWindow : WindowBase
|
|
{
|
|
private CAMetalLayer _caMetalLayer;
|
|
|
|
public CAMetalLayer GetLayer()
|
|
{
|
|
return _caMetalLayer;
|
|
}
|
|
|
|
public MetalWindow(
|
|
InputManager inputManager,
|
|
GraphicsDebugLevel glLogLevel,
|
|
AspectRatio aspectRatio,
|
|
bool enableMouse,
|
|
HideCursorMode hideCursorMode,
|
|
bool ignoreControllerApplet)
|
|
: base(inputManager, glLogLevel, aspectRatio, enableMouse, hideCursorMode, ignoreControllerApplet) { }
|
|
|
|
public override SDL_WindowFlags GetWindowFlags() => SDL_WindowFlags.SDL_WINDOW_METAL;
|
|
|
|
protected override void InitializeWindowRenderer()
|
|
{
|
|
void CreateLayer()
|
|
{
|
|
_caMetalLayer = new CAMetalLayer(SDL_Metal_GetLayer(SDL_Metal_CreateView(WindowHandle)));
|
|
}
|
|
|
|
SDL2Driver.MainThreadDispatcher?.Invoke(CreateLayer);
|
|
}
|
|
|
|
protected override void InitializeRenderer() { }
|
|
|
|
protected override void FinalizeWindowRenderer() { }
|
|
|
|
protected override void SwapBuffers() { }
|
|
}
|
|
}
|