aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Gal/OpenGL/OGLExtension.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics/Gal/OpenGL/OGLExtension.cs')
-rw-r--r--Ryujinx.Graphics/Gal/OpenGL/OGLExtension.cs43
1 files changed, 43 insertions, 0 deletions
diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLExtension.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLExtension.cs
new file mode 100644
index 00000000..69fce6d3
--- /dev/null
+++ b/Ryujinx.Graphics/Gal/OpenGL/OGLExtension.cs
@@ -0,0 +1,43 @@
+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;
+ }
+ }
+} \ No newline at end of file