aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.OpenGL/IOpenGLContext.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.Graphics.OpenGL/IOpenGLContext.cs')
-rw-r--r--src/Ryujinx.Graphics.OpenGL/IOpenGLContext.cs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Ryujinx.Graphics.OpenGL/IOpenGLContext.cs b/src/Ryujinx.Graphics.OpenGL/IOpenGLContext.cs
new file mode 100644
index 00000000..b1f6d72d
--- /dev/null
+++ b/src/Ryujinx.Graphics.OpenGL/IOpenGLContext.cs
@@ -0,0 +1,27 @@
+using Ryujinx.Graphics.OpenGL.Helper;
+using System;
+
+namespace Ryujinx.Graphics.OpenGL
+{
+ public interface IOpenGLContext : IDisposable
+ {
+ void MakeCurrent();
+
+ // TODO: Support more APIs per platform.
+ static bool HasContext()
+ {
+ if (OperatingSystem.IsWindows())
+ {
+ return WGLHelper.GetCurrentContext() != IntPtr.Zero;
+ }
+ else if (OperatingSystem.IsLinux())
+ {
+ return GLXHelper.GetCurrentContext() != IntPtr.Zero;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+}