Make IOpenGLContext.HasContext context dependent (#6290)

This makes IOpenGLContext.HasContext not static and be implementable.

By doing this, we can support more than WGL and WGL.

This also allows the SDL2 headless version to run under Wayland.

Signed-off-by: Mary <mary@mary.zone>
This commit is contained in:
Mary Guillemard 2024-02-10 20:13:10 +01:00 committed by GitHub
parent b82e789d4f
commit bd6937ae5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 10 additions and 17 deletions

View file

@ -7,21 +7,6 @@ namespace Ryujinx.Graphics.OpenGL
{
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;
}
}
bool HasContext();
}
}