mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2024-11-17 14:57:08 +01:00
43 lines
1003 B
C#
43 lines
1003 B
C#
|
using OpenTK.Graphics.OpenGL;
|
|||
|
|
|||
|
namespace Ryujinx.Graphics.Gal.OpenGL
|
|||
|
{
|
|||
|
static class OGLExtension
|
|||
|
{
|
|||
|
private static bool Initialized = false;
|
|||
|
|
|||
|
private static bool EnhancedLayouts;
|
|||
|
|
|||
|
public static bool HasEnhancedLayouts()
|
|||
|
{
|
|||
|
EnsureInitialized();
|
|||
|
|
|||
|
return EnhancedLayouts;
|
|||
|
}
|
|||
|
|
|||
|
private static void EnsureInitialized()
|
|||
|
{
|
|||
|
if (Initialized)
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
EnhancedLayouts = HasExtension("GL_ARB_enhanced_layouts");
|
|||
|
}
|
|||
|
|
|||
|
private static bool HasExtension(string Name)
|
|||
|
{
|
|||
|
int NumExtensions = GL.GetInteger(GetPName.NumExtensions);
|
|||
|
|
|||
|
for (int Extension = 0; Extension < NumExtensions; Extension++)
|
|||
|
{
|
|||
|
if (GL.GetString(StringNameIndexed.Extensions, Extension) == Name)
|
|||
|
{
|
|||
|
return true;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
return false;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|