mirror of
https://github.com/GreemDev/Ryujinx
synced 2024-12-24 21:06:44 +01:00
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>
This commit is contained in:
parent
dd433c1296
commit
8ce3993afa
1 changed files with 11 additions and 1 deletions
|
@ -51,7 +51,7 @@ namespace Ryujinx.Ui
|
||||||
private Input.NpadController _primaryController;
|
private Input.NpadController _primaryController;
|
||||||
|
|
||||||
public GLRenderer(Switch device)
|
public GLRenderer(Switch device)
|
||||||
: base (new GraphicsMode(new ColorFormat()),
|
: base (GetGraphicsMode(),
|
||||||
3, 3,
|
3, 3,
|
||||||
GraphicsContextFlags.ForwardCompatible)
|
GraphicsContextFlags.ForwardCompatible)
|
||||||
{
|
{
|
||||||
|
@ -80,6 +80,16 @@ namespace Ryujinx.Ui
|
||||||
this.Shown += Renderer_Shown;
|
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)
|
private void GLRenderer_ShuttingDown(object sender, EventArgs args)
|
||||||
{
|
{
|
||||||
_device.DisposeGpu();
|
_device.DisposeGpu();
|
||||||
|
|
Loading…
Reference in a new issue