diff options
| author | riperiperi <rhy3756547@hotmail.com> | 2020-03-14 21:36:56 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-14 22:36:56 +0100 |
| commit | 8ce3993afa222850cb896e9b6bd9303f3a9dc16b (patch) | |
| tree | 2ebf4c470b97d78611b19939d954f4ff9965a206 | |
| parent | dd433c1296bbd82e5e42bf8de1731a4eaadcfdb5 (diff) | |
Fix GTK window crash by using 24 bit surface on unix, 32 bit on windows. (#976)
* Use 24 bit surface on unix, 32 bit on windows.
* Address jd's comment
Co-authored-by: Thomas Guillemard <me@thog.eu>
| -rw-r--r-- | Ryujinx/Ui/GLRenderer.cs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Ryujinx/Ui/GLRenderer.cs b/Ryujinx/Ui/GLRenderer.cs index 416429bf..5d0d1908 100644 --- a/Ryujinx/Ui/GLRenderer.cs +++ b/Ryujinx/Ui/GLRenderer.cs @@ -51,7 +51,7 @@ namespace Ryujinx.Ui private Input.NpadController _primaryController; public GLRenderer(Switch device) - : base (new GraphicsMode(new ColorFormat()), + : base (GetGraphicsMode(), 3, 3, GraphicsContextFlags.ForwardCompatible) { @@ -80,6 +80,16 @@ namespace Ryujinx.Ui this.Shown += Renderer_Shown; } + private static GraphicsMode GetGraphicsMode() + { + if (Environment.OSVersion.Platform == PlatformID.Unix) + { + return new GraphicsMode(new ColorFormat(24)); + } + + return new GraphicsMode(new ColorFormat()); + } + private void GLRenderer_ShuttingDown(object sender, EventArgs args) { _device.DisposeGpu(); |
