aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.OpenGL/Window.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.OpenGL/Window.cs')
-rw-r--r--Ryujinx.Graphics.OpenGL/Window.cs10
1 files changed, 9 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.OpenGL/Window.cs b/Ryujinx.Graphics.OpenGL/Window.cs
index 61b739b1..8f7917f9 100644
--- a/Ryujinx.Graphics.OpenGL/Window.cs
+++ b/Ryujinx.Graphics.OpenGL/Window.cs
@@ -10,6 +10,8 @@ namespace Ryujinx.Graphics.OpenGL
private const int TextureCount = 3;
private readonly OpenGLRenderer _renderer;
+ private bool _initialized;
+
private int _width;
private int _height;
private int _copyFramebufferHandle;
@@ -179,6 +181,7 @@ namespace Ryujinx.Graphics.OpenGL
public void InitializeBackgroundContext(IOpenGLContext baseContext)
{
BackgroundContext = new BackgroundContextWorker(baseContext);
+ _initialized = true;
}
public void CaptureFrame(int x, int y, int width, int height, bool isBgra, bool flipX, bool flipY)
@@ -193,6 +196,11 @@ namespace Ryujinx.Graphics.OpenGL
public void Dispose()
{
+ if (!_initialized)
+ {
+ return;
+ }
+
BackgroundContext.Dispose();
if (_copyFramebufferHandle != 0)
@@ -203,4 +211,4 @@ namespace Ryujinx.Graphics.OpenGL
}
}
}
-}
+} \ No newline at end of file