mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-30 11:57:11 +02:00
Ava: Fix OpenGL on Linux again (#5216)
* ava: Fix OpenGL on Linux again This shouldn't be working like that, but for some reason it does. * Apply the correct fix * gtk: Add warning messages for caught exceptions * ava: Handle disposing the same way as GTK does * Address review feedback
This commit is contained in:
parent
638f3761f3
commit
9a1b74799d
4 changed files with 43 additions and 18 deletions
|
@ -1,8 +1,10 @@
|
|||
using OpenTK.Graphics.OpenGL;
|
||||
using Ryujinx.Common.Configuration;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Graphics.OpenGL;
|
||||
using Ryujinx.Input.HLE;
|
||||
using SPB.Graphics;
|
||||
using SPB.Graphics.Exceptions;
|
||||
using SPB.Graphics.OpenGL;
|
||||
using SPB.Platform;
|
||||
using SPB.Platform.GLX;
|
||||
|
@ -112,24 +114,30 @@ namespace Ryujinx.Ui
|
|||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
// Try to bind the OpenGL context before calling the shutdown event
|
||||
// Try to bind the OpenGL context before calling the shutdown event.
|
||||
try
|
||||
{
|
||||
_openGLContext?.MakeCurrent(_nativeWindow);
|
||||
}
|
||||
catch (Exception) { }
|
||||
catch (ContextException e)
|
||||
{
|
||||
Logger.Warning?.Print(LogClass.Ui, $"Failed to bind OpenGL context: {e}");
|
||||
}
|
||||
|
||||
Device?.DisposeGpu();
|
||||
NpadManager.Dispose();
|
||||
|
||||
// Unbind context and destroy everything
|
||||
// Unbind context and destroy everything.
|
||||
try
|
||||
{
|
||||
_openGLContext?.MakeCurrent(null);
|
||||
}
|
||||
catch (Exception) { }
|
||||
catch (ContextException e)
|
||||
{
|
||||
Logger.Warning?.Print(LogClass.Ui, $"Failed to unbind OpenGL context: {e}");
|
||||
}
|
||||
|
||||
_openGLContext?.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue