2023-08-02 03:36:07 +01:00
|
|
|
using Ryujinx.Common.Logging;
|
2024-08-31 21:42:56 +01:00
|
|
|
using Ryujinx.Graphics.GAL;
|
2023-08-03 01:32:59 +01:00
|
|
|
using SharpMetal.Metal;
|
|
|
|
using SharpMetal.ObjectiveCCore;
|
|
|
|
using SharpMetal.QuartzCore;
|
2024-08-31 21:42:56 +01:00
|
|
|
using System;
|
2023-07-28 03:54:24 +01:00
|
|
|
using System.Runtime.Versioning;
|
2024-08-31 21:42:56 +01:00
|
|
|
|
|
|
|
namespace Ryujinx.Graphics.Metal
|
|
|
|
{
|
2023-07-28 03:54:24 +01:00
|
|
|
[SupportedOSPlatform("macos")]
|
2024-08-31 21:42:56 +01:00
|
|
|
public class Window : IWindow, IDisposable
|
|
|
|
{
|
2023-07-28 03:54:24 +01:00
|
|
|
private readonly MetalRenderer _renderer;
|
2023-08-03 01:32:59 +01:00
|
|
|
private readonly CAMetalLayer _metalLayer;
|
2024-08-31 21:42:56 +01:00
|
|
|
|
2023-08-03 01:32:59 +01:00
|
|
|
public Window(MetalRenderer renderer, CAMetalLayer metalLayer)
|
2024-08-31 21:42:56 +01:00
|
|
|
{
|
2023-07-28 03:54:24 +01:00
|
|
|
_renderer = renderer;
|
2023-08-03 01:32:59 +01:00
|
|
|
_metalLayer = metalLayer;
|
2024-08-31 21:42:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void Present(ITexture texture, ImageCrop crop, Action swapBuffersCallback)
|
|
|
|
{
|
2023-08-03 01:32:59 +01:00
|
|
|
if (_renderer.Pipeline is Pipeline pipeline && texture is Texture tex)
|
2023-07-28 03:54:24 +01:00
|
|
|
{
|
2023-08-03 01:32:59 +01:00
|
|
|
var drawable = new CAMetalDrawable(ObjectiveC.IntPtr_objc_msgSend(_metalLayer, "nextDrawable"));
|
|
|
|
pipeline.Present(drawable, tex);
|
2023-07-28 03:54:24 +01:00
|
|
|
}
|
2024-08-31 21:42:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void SetSize(int width, int height)
|
|
|
|
{
|
2023-08-02 03:36:07 +01:00
|
|
|
Logger.Warning?.Print(LogClass.Gpu, "Not Implemented!");
|
2024-08-31 21:42:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void ChangeVSyncMode(bool vsyncEnabled)
|
|
|
|
{
|
2023-08-02 03:36:07 +01:00
|
|
|
Logger.Warning?.Print(LogClass.Gpu, "Not Implemented!");
|
2024-08-31 21:42:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void SetAntiAliasing(AntiAliasing antialiasing)
|
|
|
|
{
|
2023-08-02 03:36:07 +01:00
|
|
|
Logger.Warning?.Print(LogClass.Gpu, "Not Implemented!");
|
2024-08-31 21:42:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void SetScalingFilter(ScalingFilter type)
|
|
|
|
{
|
2023-08-02 03:36:07 +01:00
|
|
|
Logger.Warning?.Print(LogClass.Gpu, "Not Implemented!");
|
2024-08-31 21:42:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void SetScalingFilterLevel(float level)
|
|
|
|
{
|
2023-08-02 03:36:07 +01:00
|
|
|
Logger.Warning?.Print(LogClass.Gpu, "Not Implemented!");
|
2024-08-31 21:42:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void Dispose()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2023-07-28 03:54:24 +01:00
|
|
|
}
|