diff --git a/Source/Bind/CSharpSpecWriter.cs b/Source/Bind/CSharpSpecWriter.cs index 632a04c3..809380e6 100644 --- a/Source/Bind/CSharpSpecWriter.cs +++ b/Source/Bind/CSharpSpecWriter.cs @@ -341,7 +341,11 @@ namespace Bind { CreateBody(f, enums); - if (f.Deprecated && Settings.IsEnabled(Settings.Legacy.AddDeprecationWarnings)) + if (!String.IsNullOrEmpty(f.Obsolete)) + { + sw.WriteLine("[Obsolete(\"{0}\")]", f.Obsolete); + } + else if (f.Deprecated && Settings.IsEnabled(Settings.Legacy.AddDeprecationWarnings)) { sw.WriteLine("[Obsolete(\"Deprecated in OpenGL {0}\")]", f.DeprecatedVersion); } diff --git a/Source/Bind/FuncProcessor.cs b/Source/Bind/FuncProcessor.cs index 90a17703..e37821ac 100644 --- a/Source/Bind/FuncProcessor.cs +++ b/Source/Bind/FuncProcessor.cs @@ -640,6 +640,12 @@ namespace Bind { Debug.Print("Profile override not yet implemented"); } + + var obsolete = function_override.GetAttribute("obsolete", String.Empty); + if (!String.IsNullOrEmpty(obsolete)) + { + d.Obsolete = obsolete; + } } } diff --git a/Source/Bind/Structures/Delegate.cs b/Source/Bind/Structures/Delegate.cs index 0961d310..4543b1ec 100644 --- a/Source/Bind/Structures/Delegate.cs +++ b/Source/Bind/Structures/Delegate.cs @@ -52,6 +52,7 @@ namespace Bind.Structures Deprecated = d.Deprecated; DeprecatedVersion = d.DeprecatedVersion; EntryPoint = d.EntryPoint; + Obsolete = d.Obsolete; } #endregion @@ -239,6 +240,7 @@ namespace Bind.Structures public bool Deprecated { get; set; } public string DeprecatedVersion { get; set; } public string EntryPoint { get; set; } + public string Obsolete { get; set; } #endregion diff --git a/Source/Bind/XmlSpecReader.cs b/Source/Bind/XmlSpecReader.cs index 272022c3..7f247ef6 100644 --- a/Source/Bind/XmlSpecReader.cs +++ b/Source/Bind/XmlSpecReader.cs @@ -281,6 +281,7 @@ namespace Bind DeprecatedVersion = node.GetAttribute("deprecated", String.Empty).Trim(), Deprecated = !String.IsNullOrEmpty(node.GetAttribute("deprecated", String.Empty)), Extension = node.GetAttribute("extension", String.Empty).Trim() ?? "Core", + Obsolete = node.GetAttribute("obsolete", String.Empty).Trim() }; if (!extensions.Contains(d.Extension)) extensions.Add(d.Extension);