/ src / Ryujinx.Graphics.GAL / Multithreading / Commands / Window / WindowPresentCommand.cs
WindowPresentCommand.cs
 1  using Ryujinx.Graphics.GAL.Multithreading.Model;
 2  using Ryujinx.Graphics.GAL.Multithreading.Resources;
 3  using System;
 4  
 5  namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Window
 6  {
 7      struct WindowPresentCommand : IGALCommand, IGALCommand<WindowPresentCommand>
 8      {
 9          public readonly CommandType CommandType => CommandType.WindowPresent;
10          private TableRef<ThreadedTexture> _texture;
11          private ImageCrop _crop;
12          private TableRef<Action> _swapBuffersCallback;
13  
14          public void Set(TableRef<ThreadedTexture> texture, ImageCrop crop, TableRef<Action> swapBuffersCallback)
15          {
16              _texture = texture;
17              _crop = crop;
18              _swapBuffersCallback = swapBuffersCallback;
19          }
20  
21          public static void Run(ref WindowPresentCommand command, ThreadedRenderer threaded, IRenderer renderer)
22          {
23              threaded.SignalFrame();
24              renderer.Window.Present(command._texture.Get(threaded)?.Base, command._crop, command._swapBuffersCallback.Get(threaded));
25          }
26      }
27  }