mirror of
https://github.com/GreemDev/Ryujinx
synced 2024-12-27 22:29:46 +01:00
28 lines
649 B
C#
28 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;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|