Posted Monday, 26 October, 2009 - 16:45 by the Fiddler
No, there is no direct replacement. The SupportsExtension method was becoming increasingly difficult to maintain and its implementation suffered from several other issues without simple solutions.
The recommended workaround is to check for extensions using regular OpenGL commands:
// Compatible context (GL 1.0-2.1)string[] extensions = GL.GetString(StringName.Extensions).Split(' ');
if(extensions.Contains("GL_ARB_foo_bar")){// Use it}// Forward compatible context (GL 3.0+)int extensions;
GL.GetInteger(GetPName.NumExtensions, out extensions);
bool found = false;
while(--extensions > 0 && !found)
found = GL.GetString(StringName.Extensions, extensions) == "GL_ARB_foo_bar";
if(found){// Use it}
Note that it is an error to use the first approach in a forward-compatible context.
Comments
Re: OpenTK.Graphics.OpenGL.GL.SupportsExtension missing?
No, there is no direct replacement. The SupportsExtension method was becoming increasingly difficult to maintain and its implementation suffered from several other issues without simple solutions.
The recommended workaround is to check for extensions using regular OpenGL commands:
Note that it is an error to use the first approach in a forward-compatible context.
Edit: renamed num_extensions to extensions.
Re: OpenTK.Graphics.OpenGL.GL.SupportsExtension missing?
thank you!