Ryujinx/src/Ryujinx.Graphics.OpenGL/IOpenGLContext.cs
2023-04-27 23:51:14 +02:00

27 lines
649 B
C#

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;
}
}
}
}