Implemented GL.SupportsFunction(MethodInfo).
This commit is contained in:
parent
529702a317
commit
e6080ea77a
1 changed files with 12 additions and 27 deletions
|
@ -335,39 +335,24 @@ namespace OpenTK.Graphics
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region static bool SupportsFunction(Type function)
|
#region static bool SupportsFunction(MethodInfo function)
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks if a given OpenGL function is supported by the current context
|
/// Checks if a given OpenGL function is supported by the current context.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="method">The System.Reflection.MethodInfo of the OpenGL function.</param>
|
/// <param name="method">The System.Reflection.MethodInfo for the OpenGL function.</param>
|
||||||
/// <returns>True if the function is supported, false otherwise</returns>
|
/// <returns>True if the function is supported, false otherwise.</returns>
|
||||||
static bool SupportsFunction(MethodInfo method)
|
static bool SupportsFunction(MethodInfo function)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
|
||||||
#if false
|
|
||||||
lock (gl_lock)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (function == null)
|
if (function == null)
|
||||||
throw new ArgumentNullException("function");
|
throw new ArgumentNullException("function");
|
||||||
|
|
||||||
sb.Remove(0, sb.Length);
|
AutoGeneratedAttribute[] attr = (AutoGeneratedAttribute[])
|
||||||
if (!function.Name.StartsWith("gl"))
|
function.GetCustomAttributes(typeof(AutoGeneratedAttribute), false);
|
||||||
sb.Append("gl");
|
if (attr.Length == 0)
|
||||||
sb.Append(function);
|
|
||||||
//if (!function.EndsWith(extension))
|
|
||||||
// sb.Append(extension);
|
|
||||||
|
|
||||||
FieldInfo f = delegatesClass.GetField(sb.ToString(), BindingFlags.Static | BindingFlags.NonPublic);
|
|
||||||
if (f == null)
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return f.GetValue(null) != null;
|
return SupportsFunction(attr[0].EntryPoint);
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
Loading…
Reference in a new issue