diff options
| author | Ac_K <Acoustik666@gmail.com> | 2023-01-16 01:14:01 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-16 01:14:01 +0100 |
| commit | 784cf9d5947d60d146e518a7913220155362396b (patch) | |
| tree | d03aa9efe879f48c64ee96a8d7432e3026c35819 /Ryujinx.Ava/UI/Helpers/OpenGLEmbeddedWindow.cs | |
| parent | 64263c5218271f2e217aa593b4e47a59fe097835 (diff) | |
Ava UI: `Renderer` refactoring (#4297)
* Ava UI: `Renderer` refactoring
* Fix Vulkan CreateSurface
Diffstat (limited to 'Ryujinx.Ava/UI/Helpers/OpenGLEmbeddedWindow.cs')
| -rw-r--r-- | Ryujinx.Ava/UI/Helpers/OpenGLEmbeddedWindow.cs | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/Ryujinx.Ava/UI/Helpers/OpenGLEmbeddedWindow.cs b/Ryujinx.Ava/UI/Helpers/OpenGLEmbeddedWindow.cs deleted file mode 100644 index db77f66b..00000000 --- a/Ryujinx.Ava/UI/Helpers/OpenGLEmbeddedWindow.cs +++ /dev/null @@ -1,82 +0,0 @@ -using OpenTK.Graphics.OpenGL; -using Ryujinx.Common.Configuration; -using SPB.Graphics; -using SPB.Graphics.OpenGL; -using SPB.Platform; -using SPB.Platform.WGL; -using SPB.Windowing; -using System; - -namespace Ryujinx.Ava.UI.Helpers -{ - public class OpenGLEmbeddedWindow : EmbeddedWindow - { - private readonly int _major; - private readonly int _minor; - private readonly GraphicsDebugLevel _graphicsDebugLevel; - private SwappableNativeWindowBase _window; - public OpenGLContextBase Context { get; set; } - - public OpenGLEmbeddedWindow(int major, int minor, GraphicsDebugLevel graphicsDebugLevel) - { - _major = major; - _minor = minor; - _graphicsDebugLevel = graphicsDebugLevel; - } - - protected override void OnWindowDestroying() - { - Context.Dispose(); - base.OnWindowDestroying(); - } - - public override void OnWindowCreated() - { - base.OnWindowCreated(); - - if (OperatingSystem.IsWindows()) - { - _window = new WGLWindow(new NativeHandle(WindowHandle)); - } - else if (OperatingSystem.IsLinux()) - { - _window = X11Window; - } - else - { - throw new PlatformNotSupportedException(); - } - - var flags = OpenGLContextFlags.Compat; - if (_graphicsDebugLevel != GraphicsDebugLevel.None) - { - flags |= OpenGLContextFlags.Debug; - } - - Context = PlatformHelper.CreateOpenGLContext(FramebufferFormat.Default, _major, _minor, flags); - - Context.Initialize(_window); - Context.MakeCurrent(_window); - - var bindingsContext = new OpenToolkitBindingsContext(Context.GetProcAddress); - - GL.LoadBindings(bindingsContext); - Context.MakeCurrent(null); - } - - public void MakeCurrent() - { - Context?.MakeCurrent(_window); - } - - public void MakeCurrent(NativeWindowBase window) - { - Context?.MakeCurrent(window); - } - - public void SwapBuffers() - { - _window.SwapBuffers(); - } - } -}
\ No newline at end of file |
