1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2025-01-02 03:46:00 +00:00
Ryujinx/src/Ryujinx.Graphics.Metal/Window.cs

63 lines
1.7 KiB
C#
Raw Normal View History

2023-08-02 03:36:07 +01:00
using Ryujinx.Common.Logging;
using Ryujinx.Graphics.GAL;
2023-08-03 01:32:59 +01:00
using SharpMetal.Metal;
using SharpMetal.ObjectiveCCore;
using SharpMetal.QuartzCore;
using System;
2023-07-28 03:54:24 +01:00
using System.Runtime.Versioning;
namespace Ryujinx.Graphics.Metal
{
2023-07-28 03:54:24 +01:00
[SupportedOSPlatform("macos")]
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;
2023-08-03 01:32:59 +01:00
public Window(MetalRenderer renderer, CAMetalLayer metalLayer)
{
2023-07-28 03:54:24 +01:00
_renderer = renderer;
2023-08-03 01:32:59 +01:00
_metalLayer = metalLayer;
}
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
}
}
public void SetSize(int width, int height)
{
2023-08-02 03:36:07 +01:00
Logger.Warning?.Print(LogClass.Gpu, "Not Implemented!");
}
public void ChangeVSyncMode(bool vsyncEnabled)
{
2023-08-02 03:36:07 +01:00
Logger.Warning?.Print(LogClass.Gpu, "Not Implemented!");
}
public void SetAntiAliasing(AntiAliasing antialiasing)
{
2023-08-02 03:36:07 +01:00
Logger.Warning?.Print(LogClass.Gpu, "Not Implemented!");
}
public void SetScalingFilter(ScalingFilter type)
{
2023-08-02 03:36:07 +01:00
Logger.Warning?.Print(LogClass.Gpu, "Not Implemented!");
}
public void SetScalingFilterLevel(float level)
{
2023-08-02 03:36:07 +01:00
Logger.Warning?.Print(LogClass.Gpu, "Not Implemented!");
}
public void Dispose()
{
}
}
2023-07-28 03:54:24 +01:00
}