Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'es_docs' into develop

  • Loading branch information...
commit 4ce1289d85d50c2d293f7039b83d26422bac1620 2 parents 985aca3 + bd920a1
@thefiddler thefiddler authored
Showing with 20,090 additions and 1,004 deletions.
  1. +41 −11 Source/Bind/BindStreamWriter.cs
  2. +80 −58 Source/Bind/CSharpSpecWriter.cs
  3. +21 −44 Source/Bind/CppSpecWriter.cs
  4. +132 −30 Source/Bind/DocProcessor.cs
  5. +9 −1 Source/Bind/ES/ES2Generator.cs
  6. +9 −1 Source/Bind/ES/ES3Generator.cs
  7. +2 −0  Source/Bind/ES/ESGenerator.cs
  8. +18 −2 Source/Bind/FuncProcessor.cs
  9. +61 −0 Source/Bind/GL2/GL2Generator.cs
  10. +2 −0  Source/Bind/GL2/GL4Generator.cs
  11. +4 −18 Source/Bind/GL2/Generator.cs
  12. +5 −790 Source/Bind/Generator.Bind.csproj
  13. +19 −44 Source/Bind/JavaSpecWriter.cs
  14. +2 −2 Source/Bind/Main.cs
  15. +3 −3 Source/Bind/Settings.cs
  16. +78 −0 Source/Bind/Specifications/Docs/ES20/glActiveTexture.xml
  17. +107 −0 Source/Bind/Specifications/Docs/ES20/glAttachShader.xml
  18. +186 −0 Source/Bind/Specifications/Docs/ES20/glBindAttribLocation.xml
  19. +139 −0 Source/Bind/Specifications/Docs/ES20/glBindBuffer.xml
  20. +160 −0 Source/Bind/Specifications/Docs/ES20/glBindFramebuffer.xml
  21. +123 −0 Source/Bind/Specifications/Docs/ES20/glBindRenderbuffer.xml
  22. +132 −0 Source/Bind/Specifications/Docs/ES20/glBindTexture.xml
  23. +82 −0 Source/Bind/Specifications/Docs/ES20/glBlendColor.xml
  24. +549 −0 Source/Bind/Specifications/Docs/ES20/glBlendEquation.xml
  25. +560 −0 Source/Bind/Specifications/Docs/ES20/glBlendEquationSeparate.xml
  26. +989 −0 Source/Bind/Specifications/Docs/ES20/glBlendFunc.xml
  27. +1,071 −0 Source/Bind/Specifications/Docs/ES20/glBlendFuncSeparate.xml
  28. +179 −0 Source/Bind/Specifications/Docs/ES20/glBufferData.xml
  29. +126 −0 Source/Bind/Specifications/Docs/ES20/glBufferSubData.xml
  30. +164 −0 Source/Bind/Specifications/Docs/ES20/glCheckFramebufferStatus.xml
  31. +140 −0 Source/Bind/Specifications/Docs/ES20/glClear.xml
  32. +81 −0 Source/Bind/Specifications/Docs/ES20/glClearColor.xml
  33. +71 −0 Source/Bind/Specifications/Docs/ES20/glClearDepthf.xml
  34. +87 −0 Source/Bind/Specifications/Docs/ES20/glClearStencil.xml
  35. +84 −0 Source/Bind/Specifications/Docs/ES20/glColorMask.xml
  36. +104 −0 Source/Bind/Specifications/Docs/ES20/glCompileShader.xml
  37. +245 −0 Source/Bind/Specifications/Docs/ES20/glCompressedTexImage2D.xml
  38. +323 −0 Source/Bind/Specifications/Docs/ES20/glCompressedTexSubImage2D.xml
  39. +282 −0 Source/Bind/Specifications/Docs/ES20/glCopyTexImage2D.xml
  40. +328 −0 Source/Bind/Specifications/Docs/ES20/glCopyTexSubImage2D.xml
  41. +117 −0 Source/Bind/Specifications/Docs/ES20/glCreateProgram.xml
  42. +99 −0 Source/Bind/Specifications/Docs/ES20/glCreateShader.xml
  43. +90 −0 Source/Bind/Specifications/Docs/ES20/glCullFace.xml
  44. +86 −0 Source/Bind/Specifications/Docs/ES20/glDeleteBuffers.xml
  45. +86 −0 Source/Bind/Specifications/Docs/ES20/glDeleteFramebuffers.xml
  46. +85 −0 Source/Bind/Specifications/Docs/ES20/glDeleteProgram.xml
  47. +93 −0 Source/Bind/Specifications/Docs/ES20/glDeleteRenderbuffers.xml
  48. +81 −0 Source/Bind/Specifications/Docs/ES20/glDeleteShader.xml
  49. +86 −0 Source/Bind/Specifications/Docs/ES20/glDeleteTextures.xml
  50. +168 −0 Source/Bind/Specifications/Docs/ES20/glDepthFunc.xml
  51. +73 −0 Source/Bind/Specifications/Docs/ES20/glDepthMask.xml
  52. +121 −0 Source/Bind/Specifications/Docs/ES20/glDepthRangef.xml
  53. +91 −0 Source/Bind/Specifications/Docs/ES20/glDetachShader.xml
  54. +130 −0 Source/Bind/Specifications/Docs/ES20/glDrawArrays.xml
  55. +144 −0 Source/Bind/Specifications/Docs/ES20/glDrawElements.xml
  56. +209 −0 Source/Bind/Specifications/Docs/ES20/glEnable.xml
  57. +86 −0 Source/Bind/Specifications/Docs/ES20/glEnableVertexAttribArray.xml
  58. +54 −0 Source/Bind/Specifications/Docs/ES20/glFinish.xml
  59. +68 −0 Source/Bind/Specifications/Docs/ES20/glFlush.xml
  60. +141 −0 Source/Bind/Specifications/Docs/ES20/glFramebufferRenderbuffer.xml
  61. +182 −0 Source/Bind/Specifications/Docs/ES20/glFramebufferTexture2D.xml
  62. +95 −0 Source/Bind/Specifications/Docs/ES20/glFrontFace.xml
  63. +90 −0 Source/Bind/Specifications/Docs/ES20/glGenBuffers.xml
  64. +90 −0 Source/Bind/Specifications/Docs/ES20/glGenFramebuffers.xml
  65. +90 −0 Source/Bind/Specifications/Docs/ES20/glGenRenderbuffers.xml
  66. +95 −0 Source/Bind/Specifications/Docs/ES20/glGenTextures.xml
  67. +82 −0 Source/Bind/Specifications/Docs/ES20/glGenerateMipmap.xml
  68. +1,147 −0 Source/Bind/Specifications/Docs/ES20/glGet.xml
  69. +194 −0 Source/Bind/Specifications/Docs/ES20/glGetActiveAttrib.xml
  70. +246 −0 Source/Bind/Specifications/Docs/ES20/glGetActiveUniform.xml
  71. +109 −0 Source/Bind/Specifications/Docs/ES20/glGetAttachedShaders.xml
  72. +103 −0 Source/Bind/Specifications/Docs/ES20/glGetAttribLocation.xml
  73. +118 −0 Source/Bind/Specifications/Docs/ES20/glGetBufferParameteriv.xml
  74. +148 −0 Source/Bind/Specifications/Docs/ES20/glGetError.xml
  75. +190 −0 Source/Bind/Specifications/Docs/ES20/glGetFramebufferAttachmentParameteriv.xml
  76. +125 −0 Source/Bind/Specifications/Docs/ES20/glGetProgramInfoLog.xml
  77. +213 −0 Source/Bind/Specifications/Docs/ES20/glGetProgramiv.xml
  78. +222 −0 Source/Bind/Specifications/Docs/ES20/glGetRenderbufferParameteriv.xml
  79. +122 −0 Source/Bind/Specifications/Docs/ES20/glGetShaderInfoLog.xml
  80. +220 −0 Source/Bind/Specifications/Docs/ES20/glGetShaderPrecisionFormat.xml
  81. +110 −0 Source/Bind/Specifications/Docs/ES20/glGetShaderSource.xml
  82. +187 −0 Source/Bind/Specifications/Docs/ES20/glGetShaderiv.xml
  83. +138 −0 Source/Bind/Specifications/Docs/ES20/glGetString.xml
  84. +151 −0 Source/Bind/Specifications/Docs/ES20/glGetTexParameter.xml
  85. +135 −0 Source/Bind/Specifications/Docs/ES20/glGetUniform.xml
  86. +122 −0 Source/Bind/Specifications/Docs/ES20/glGetUniformLocation.xml
  87. +199 −0 Source/Bind/Specifications/Docs/ES20/glGetVertexAttrib.xml
  88. +91 −0 Source/Bind/Specifications/Docs/ES20/glGetVertexAttribPointerv.xml
  89. +134 −0 Source/Bind/Specifications/Docs/ES20/glHint.xml
  90. +66 −0 Source/Bind/Specifications/Docs/ES20/glIsBuffer.xml
  91. +169 −0 Source/Bind/Specifications/Docs/ES20/glIsEnabled.xml
  92. +65 −0 Source/Bind/Specifications/Docs/ES20/glIsFramebuffer.xml
  93. +62 −0 Source/Bind/Specifications/Docs/ES20/glIsProgram.xml
  94. +65 −0 Source/Bind/Specifications/Docs/ES20/glIsRenderbuffer.xml
  95. +62 −0 Source/Bind/Specifications/Docs/ES20/glIsShader.xml
  96. +70 −0 Source/Bind/Specifications/Docs/ES20/glIsTexture.xml
  97. +118 −0 Source/Bind/Specifications/Docs/ES20/glLineWidth.xml
  98. +210 −0 Source/Bind/Specifications/Docs/ES20/glLinkProgram.xml
  99. +194 −0 Source/Bind/Specifications/Docs/ES20/glPixelStorei.xml
  100. +117 −0 Source/Bind/Specifications/Docs/ES20/glPolygonOffset.xml
  101. +333 −0 Source/Bind/Specifications/Docs/ES20/glReadPixels.xml
  102. +64 −0 Source/Bind/Specifications/Docs/ES20/glReleaseShaderCompiler.xml
  103. +111 −0 Source/Bind/Specifications/Docs/ES20/glRenderbufferStorage.xml
  104. +113 −0 Source/Bind/Specifications/Docs/ES20/glSampleCoverage.xml
  105. +109 −0 Source/Bind/Specifications/Docs/ES20/glScissor.xml
  106. +151 −0 Source/Bind/Specifications/Docs/ES20/glShaderBinary.xml
  107. +136 −0 Source/Bind/Specifications/Docs/ES20/glShaderSource.xml
  108. +292 −0 Source/Bind/Specifications/Docs/ES20/glStencilFunc.xml
  109. +306 −0 Source/Bind/Specifications/Docs/ES20/glStencilFuncSeparate.xml
  110. +99 −0 Source/Bind/Specifications/Docs/ES20/glStencilMask.xml
  111. +113 −0 Source/Bind/Specifications/Docs/ES20/glStencilMaskSeparate.xml
  112. +270 −0 Source/Bind/Specifications/Docs/ES20/glStencilOp.xml
  113. +282 −0 Source/Bind/Specifications/Docs/ES20/glStencilOpSeparate.xml
  114. +414 −0 Source/Bind/Specifications/Docs/ES20/glTexImage2D.xml
  115. +607 −0 Source/Bind/Specifications/Docs/ES20/glTexParameter.xml
  116. +322 −0 Source/Bind/Specifications/Docs/ES20/glTexSubImage2D.xml
  117. +432 −0 Source/Bind/Specifications/Docs/ES20/glUniform.xml
  118. +155 −0 Source/Bind/Specifications/Docs/ES20/glUseProgram.xml
  119. +111 −0 Source/Bind/Specifications/Docs/ES20/glValidateProgram.xml
  120. +222 −0 Source/Bind/Specifications/Docs/ES20/glVertexAttrib.xml
  121. +196 −0 Source/Bind/Specifications/Docs/ES20/glVertexAttribPointer.xml
Sorry, we could not display the entire diff because too many files (1,558) changed.
View
52 Source/Bind/BindStreamWriter.cs
@@ -35,6 +35,12 @@
namespace Bind
{
+ enum WriteOptions
+ {
+ Default = 0,
+ NoIndent = 1
+ }
+
class BindStreamWriter : IDisposable
{
static readonly char[] SplitCharacters = new char[] { '\r', '\n' };
@@ -60,7 +66,7 @@ public void Unindent()
--indent_level;
}
- public void Write(string value)
+ public void Write(WriteOptions options, string value)
{
var lines = value.Split(SplitCharacters,
StringSplitOptions.RemoveEmptyEntries);
@@ -71,24 +77,34 @@ public void Write(string value)
for (int i = 0; i < lines.Length - 1; i++)
{
var line = lines[i];
- WriteIndentations();
+ WriteIndentations(options);
sw.Write(line);
sw.Write(System.Environment.NewLine);
}
// Write the last line without appending a newline
- WriteIndentations();
+ WriteIndentations(options);
sw.Write(lines[lines.Length - 1]);
}
else
{
- WriteIndentations();
+ WriteIndentations(options);
sw.Write(value);
}
}
+ public void Write(WriteOptions options, string format, params object[] args)
+ {
+ Write(options, String.Format(format, args));
+ }
+
+ public void Write(string value)
+ {
+ Write(WriteOptions.Default, value);
+ }
+
public void Write(string format, params object[] args)
{
- Write(String.Format(format, args));
+ Write(WriteOptions.Default, format, args);
}
public void WriteLine()
@@ -96,15 +112,26 @@ public void WriteLine()
sw.WriteLine();
}
- public void WriteLine(string value)
+ public void WriteLine(WriteOptions options, string value)
{
- Write(value);
+ Write(options, value);
WriteLine();
}
+ public void WriteLine(WriteOptions options, string format, params object[] args)
+ {
+ WriteLine(options, String.Format(format, args));
+ }
+
+
+ public void WriteLine(string value)
+ {
+ WriteLine(WriteOptions.Default, value);
+ }
+
public void WriteLine(string format, params object[] args)
{
- WriteLine(String.Format(format, args));
+ WriteLine(WriteOptions.Default, format, args);
}
public void Flush()
@@ -117,10 +144,13 @@ public void Close()
sw.Close();
}
- void WriteIndentations()
+ void WriteIndentations(WriteOptions options)
{
- for (int i = indent_level; i > 0; i--)
- sw.Write(" ");
+ if (options != WriteOptions.NoIndent)
+ {
+ for (int i = indent_level; i > 0; i--)
+ sw.Write(" ");
+ }
}
public void Dispose()
View
138 Source/Bind/CSharpSpecWriter.cs
@@ -41,7 +41,6 @@ namespace Bind
sealed class CSharpSpecWriter : ISpecWriter
{
- readonly char[] numbers = "0123456789".ToCharArray();
IBind Generator { get; set; }
Settings Settings { get { return Generator.Settings; } }
@@ -268,89 +267,112 @@ private void WriteMethod(BindStreamWriter sw, Function f, EnumCollection enums)
sw.WriteLine("public static {0} {{ throw new NotImplementedException(); }}", GetDeclarationString(f, Settings.Compatibility));
}
- DocProcessor processor_;
- DocProcessor Processor
- {
- get
- {
- if (processor_ == null)
- processor_ = new DocProcessor(Path.Combine(Settings.DocPath, Settings.DocFile));
- return processor_;
- }
- }
- Dictionary<string, string> docfiles;
void WriteDocumentation(BindStreamWriter sw, Function f)
{
- if (docfiles == null)
- {
- docfiles = new Dictionary<string, string>();
- foreach (string file in Directory.GetFiles(Settings.DocPath))
- {
- docfiles.Add(Path.GetFileName(file), file);
- }
- }
+ var docs = f.Documentation;
- string docfile = null;
try
{
- docfile = Settings.FunctionPrefix + f.WrappedDelegate.Name + ".xml";
- if (!docfiles.ContainsKey(docfile))
- docfile = Settings.FunctionPrefix + f.TrimmedName + ".xml";
- if (!docfiles.ContainsKey(docfile))
- docfile = Settings.FunctionPrefix + f.TrimmedName.TrimEnd(numbers) + ".xml";
-
- var docs = new List<string>();
- if (docfiles.ContainsKey(docfile))
- {
- docs.AddRange(Processor.ProcessFile(docfiles[docfile]));
- }
- if (docs.Count == 0)
- {
- docs.Add("/// <summary></summary>");
- }
-
- int summary_start = docs[0].IndexOf("<summary>") + "<summary>".Length;
- string warning = "[deprecated: v{0}]";
- string category = "[requires: {0}]";
+ string warning = String.Empty;
+ string category = String.Empty;
if (f.Deprecated)
{
- warning = String.Format(warning, f.DeprecatedVersion);
- docs[0] = docs[0].Insert(summary_start, warning);
+ warning = String.Format("[deprecated: v{0}]", f.DeprecatedVersion);
}
if (f.Extension != "Core" && !String.IsNullOrEmpty(f.Category))
{
- category = String.Format(category, f.Category);
- docs[0] = docs[0].Insert(summary_start, category);
+ category = String.Format("[requires: {0}]", f.Category);
}
else if (!String.IsNullOrEmpty(f.Version))
{
if (f.Category.StartsWith("VERSION"))
- category = String.Format(category, "v" + f.Version);
+ category = String.Format("[requires: {0}]", "v" + f.Version);
else
- category = String.Format(category, "v" + f.Version + " and " + f.Category);
- docs[0] = docs[0].Insert(summary_start, category);
+ category = String.Format("[requires: {0}]", "v" + f.Version + " or " + f.Category);
}
- foreach (var param in f.WrappedDelegate.Parameters)
+ // Write function summary
+ sw.Write("/// <summary>");
+ if (!String.IsNullOrEmpty(category) || !String.IsNullOrEmpty(warning))
{
- var index = docs.IndexOf("/// <param name=\"" + param.Name +"\">");
- if (index != -1 && param.ComputeSize != "")
- {
- var compute_size = string.Format("[length: {0}]", param.ComputeSize);
- docs[index] = docs[index] + compute_size;
- }
+ sw.Write(WriteOptions.NoIndent, "{0}{1}", category, warning);
+ }
+ if (!String.IsNullOrEmpty(docs.Summary))
+ {
+ sw.WriteLine();
+ sw.WriteLine("/// {0}", docs.Summary);
+ sw.WriteLine("/// </summary>");
+ }
+ else
+ {
+ sw.WriteLine(WriteOptions.NoIndent, "</summary>");
}
- foreach (var doc in docs)
+ // Write function parameters
+ for (int i = 0; i < f.Parameters.Count; i++)
{
- sw.WriteLine(doc);
+ var param = f.Parameters[i];
+
+ string length = String.Empty;
+ if (!String.IsNullOrEmpty(param.ComputeSize))
+ {
+ length = String.Format("[length: {0}]", param.ComputeSize);
+ }
+
+ // Try to match the correct parameter from documentation:
+ // - first by name
+ // - then by index
+ var docparam =
+ (docs.Parameters
+ .Where(p => p.Name == param.RawName)
+ .FirstOrDefault()) ??
+ (docs.Parameters.Count > i ?
+ docs.Parameters[i] : null);
+
+ if (docparam != null)
+ {
+ if (docparam.Name != param.RawName &&
+ docparam.Name != param.RawName.Substring(1)) // '@ref' -> 'ref' etc
+ {
+ Console.Error.WriteLine(
+ "[Warning] Parameter '{0}' in function '{1}' has incorrect doc name '{2}'",
+ param.RawName, f.Name, docparam.Name);
+ }
+
+ // Note: we use param.Name, because the documentation sometimes
+ // uses different names than the specification.
+ sw.Write("/// <param name=\"{0}\">", param.Name);
+ if (!String.IsNullOrEmpty(length))
+ {
+ sw.Write(WriteOptions.NoIndent, "{0}", length);
+ }
+ if (!String.IsNullOrEmpty(docparam.Documentation))
+ {
+ sw.WriteLine(WriteOptions.NoIndent, " ");
+ sw.WriteLine("/// {0}", docparam.Documentation);
+ sw.WriteLine("/// </param>");
+ }
+ else
+ {
+ sw.WriteLine(WriteOptions.NoIndent, "</param>");
+ }
+ }
+ else
+ {
+ Console.Error.WriteLine(
+ "[Warning] Parameter '{0}' in function '{1}' not found in documentation '{{{3}}}'",
+ param.Name, f.Name,
+ String.Join(",", docs.Parameters.Select(p => p.Name).ToArray()));
+ sw.WriteLine("/// <param name=\"{0}\">{1}</param>",
+ param.Name, length);
+ }
}
}
catch (Exception e)
{
- Console.WriteLine("[Warning] Error processing file {0}: {1}", docfile, e.ToString());
- }
+ Console.WriteLine("[Warning] Error documenting function {0}: {1}", f.WrappedDelegate.Name, e.ToString());
+ }
}
#endregion
View
65 Source/Bind/CppSpecWriter.cs
@@ -41,7 +41,6 @@ namespace Bind
sealed class CppSpecWriter : ISpecWriter
{
- readonly char[] numbers = "0123456789".ToCharArray();
const string AllowDeprecated = "GLPP_COMPATIBLE";
const string DigitPrefix = "T"; // Prefix for identifiers that start with a digit
const string OutputFileHeader = "gl++.h";
@@ -665,60 +664,24 @@ static object GenerateCallString(Function f)
return sb.ToString();
}
- DocProcessor processor_;
- DocProcessor Processor
- {
- get
- {
- if (processor_ == null)
- processor_ = new DocProcessor(Path.Combine(Settings.DocPath, Settings.DocFile));
- return processor_;
- }
- }
- Dictionary<string, string> docfiles;
void WriteDocumentation(BindStreamWriter sw, Function f)
{
- if (docfiles == null)
- {
- docfiles = new Dictionary<string, string>();
- foreach (string file in Directory.GetFiles(Settings.DocPath))
- {
- docfiles.Add(Path.GetFileName(file), file);
- }
- }
+ var docs = f.Documentation;
- string docfile = null;
try
{
- docfile = Settings.FunctionPrefix + f.WrappedDelegate.Name + ".xml";
- if (!docfiles.ContainsKey(docfile))
- docfile = Settings.FunctionPrefix + f.TrimmedName + ".xml";
- if (!docfiles.ContainsKey(docfile))
- docfile = Settings.FunctionPrefix + f.TrimmedName.TrimEnd(numbers) + ".xml";
-
- var docs = new List<string>();
- if (docfiles.ContainsKey(docfile))
- {
- docs.AddRange(Processor.ProcessFile(docfiles[docfile]));
- }
- if (docs.Count == 0)
- {
- docs.Add("/// <summary></summary>");
- }
-
- int summary_start = docs[0].IndexOf("<summary>") + "<summary>".Length;
string warning = "[deprecated: v{0}]";
string category = "[requires: {0}]";
if (f.Deprecated)
{
warning = String.Format(warning, f.DeprecatedVersion);
- docs[0] = docs[0].Insert(summary_start, warning);
+ docs.Summary = docs.Summary.Insert(0, warning);
}
if (f.Extension != "Core" && !String.IsNullOrEmpty(f.Category))
{
category = String.Format(category, f.Category);
- docs[0] = docs[0].Insert(summary_start, category);
+ docs.Summary = docs.Summary.Insert(0, category);
}
else if (!String.IsNullOrEmpty(f.Version))
{
@@ -726,17 +689,31 @@ void WriteDocumentation(BindStreamWriter sw, Function f)
category = String.Format(category, "v" + f.Version);
else
category = String.Format(category, "v" + f.Version + " and " + f.Category);
- docs[0] = docs[0].Insert(summary_start, category);
+ docs.Summary = docs.Summary.Insert(0, category);
+ }
+
+ for (int i = 0; i < f.WrappedDelegate.Parameters.Count; i++)
+ {
+ var param = f.WrappedDelegate.Parameters[i];
+ if (param.ComputeSize != String.Empty)
+ {
+ docs.Parameters[i].Documentation.Insert(0,
+ String.Format("[length: {0}]", param.ComputeSize));
+ }
}
- foreach (var doc in docs)
+ sw.Write("/// \brief ");
+ sw.WriteLine(docs.Summary);
+ foreach (var p in docs.Parameters)
{
- sw.WriteLine(doc);
+ sw.Write(@"/// \param ");
+ sw.Write(p.Name);
+ sw.WriteLine(p.Documentation);
}
}
catch (Exception e)
{
- Console.WriteLine("[Warning] Error processing file {0}: {1}", docfile, e.ToString());
+ Console.WriteLine("[Warning] Error documenting function {0}: {1}", f.WrappedDelegate.Name, e.ToString());
}
}
View
162 Source/Bind/DocProcessor.cs
@@ -1,44 +1,108 @@
using System;
+using System.Collections;
+using System.Collections.Generic;
using System.IO;
+using System.Linq;
+using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
-using System.Xml.Xsl;
+using System.Xml.Linq;
+using System.Xml.XPath;
+
+using Bind.Structures;
namespace Bind
{
class DocProcessor
{
+ static readonly char[] numbers = "0123456789".ToCharArray();
static readonly Regex remove_mathml = new Regex(
@"<(mml:math|inlineequation)[^>]*?>(?:.|\n)*?</\s*\1\s*>",
RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.IgnorePatternWhitespace);
+ static readonly Regex remove_doctype = new Regex(
+ @"<!DOCTYPE[^>\[]*(\[.*\])?>", RegexOptions.Compiled | RegexOptions.Multiline);
+ static readonly Regex remove_xmlns = new Regex(
+ "xmlns=\".+\"", RegexOptions.Compiled);
- static readonly XslCompiledTransform xslt = new XslCompiledTransform();
- static readonly XmlReaderSettings settings = new XmlReaderSettings();
+ readonly Dictionary<string, string> DocumentationFiles =
+ new Dictionary<string, string>();
+ readonly Dictionary<string, Documentation> DocumentationCache =
+ new Dictionary<string, Documentation>();
- string[] Text;
+ Documentation Cached;
string LastFile;
- public DocProcessor(string transform_file)
+ IBind Generator { get; set; }
+ Settings Settings { get { return Generator.Settings; } }
+
+ public DocProcessor(IBind generator)
+ {
+ if (generator == null)
+ throw new ArgumentNullException();
+
+ Generator = generator;
+ foreach (string file in Directory.GetFiles(Settings.DocPath).Concat(
+ Directory.GetFiles(Settings.FallbackDocPath)))
+ {
+ var name = Path.GetFileName(file);
+ if (!DocumentationFiles.ContainsKey(name))
+ {
+ DocumentationFiles.Add(name, file);
+ }
+ }
+ }
+
+ public Documentation Process(Function f, EnumProcessor processor)
{
- xslt.Load(transform_file);
- settings.ProhibitDtd = false;
- settings.XmlResolver = null;
+ Documentation docs = null;
+
+ if (DocumentationCache.ContainsKey(f.WrappedDelegate.Name))
+ {
+ return DocumentationCache[f.WrappedDelegate.Name];
+ }
+ else
+ {
+ var file = Settings.FunctionPrefix + f.WrappedDelegate.Name + ".xml";
+ if (!DocumentationFiles.ContainsKey(file))
+ file = Settings.FunctionPrefix + f.TrimmedName + ".xml";
+ if (!DocumentationFiles.ContainsKey(file))
+ file = Settings.FunctionPrefix + f.TrimmedName.TrimEnd(numbers) + ".xml";
+
+ docs =
+ (DocumentationFiles.ContainsKey(file) ? ProcessFile(DocumentationFiles[file], processor) : null) ??
+ new Documentation
+ {
+ Summary = String.Empty,
+ Parameters = f.Parameters.Select(p =>
+ new DocumentationParameter(p.Name, String.Empty)).ToList()
+ };
+
+ DocumentationCache.Add(f.WrappedDelegate.Name, docs);
+ }
+
+ return docs;
}
// Strips MathML tags from the source and replaces the equations with the content
// found in the <!-- eqn: :--> comments in the docs.
// Todo: Some simple MathML tags do not include comments, find a solution.
// Todo: Some files include more than 1 function - find a way to map these extra functions.
- public string[] ProcessFile(string file)
+ Documentation ProcessFile(string file, EnumProcessor processor)
{
string text;
if (LastFile == file)
- return Text;
+ return Cached;
LastFile = file;
text = File.ReadAllText(file);
+ text = text
+ .Replace("&epsi;", "epsilon") // Fix unrecognized &epsi; entities
+ .Replace("xml:", String.Empty); // Remove namespaces
+ text = remove_doctype.Replace(text, String.Empty);
+ text = remove_xmlns.Replace(text, string.Empty);
+
Match m = remove_mathml.Match(text);
while (m.Length > 0)
{
@@ -69,34 +133,72 @@ public string[] ProcessFile(string file)
m = remove_mathml.Match(text);
}
- XmlReader doc = null;
+ XDocument doc = null;
try
{
- // The pure XmlReader is ~20x faster than the XmlTextReader.
- doc = XmlReader.Create(new StringReader(text), settings);
- //doc = new XmlTextReader(new StringReader(text));
-
- using (StringWriter sw = new StringWriter())
- {
- xslt.Transform(doc, null, sw);
- Text = sw.ToString().Split(new char[] { '\r', '\n' },
- StringSplitOptions.RemoveEmptyEntries);
+ doc = XDocument.Parse(text);
+ Cached = ToInlineDocs(doc, processor);
+ return Cached;
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(e.ToString());
+ Console.WriteLine(doc.ToString());
+ return null;
+ }
+ }
- // Remove unecessary whitespace
- // Indentation is handled by BindStreamWriter
- for (int i = 0; i < Text.Length; i++)
+ Documentation ToInlineDocs(XDocument doc, EnumProcessor enum_processor)
+ {
+ if (doc == null || enum_processor == null)
+ throw new ArgumentNullException();
+
+ var no_const_processing = Settings.Legacy.NoAdvancedEnumProcessing | Settings.Legacy.ConstIntEnums;
+ if (!Generator.Settings.IsEnabled(no_const_processing))
+ {
+ // Translate all GL_FOO_BAR constants according to EnumProcessor
+ foreach (var e in doc.XPathSelectElements("//constant"))
+ {
+ var c = e.Value;
+ if (c.StartsWith(Settings.ConstantPrefix))
{
- Text[i] = Text[i].Trim();
+ // Remove "GL_" from the beginning of the string
+ c = c.Replace(Settings.ConstantPrefix, String.Empty);
}
- return Text;
+ e.Value = enum_processor.TranslateConstantName(c, false);
}
}
- catch (XmlException e)
+
+ // Create inline documentation
+ var inline = new Documentation
{
- Console.WriteLine(e.ToString());
- Console.WriteLine(doc.ToString());
- return new string[0];
- }
+ Summary =
+ Cleanup(
+ ((IEnumerable)doc.XPathEvaluate("/refentry/refnamediv/refpurpose"))
+ .Cast<XElement>().First().Value),
+ Parameters =
+ ((IEnumerable)doc.XPathEvaluate("/refentry/refsect1[@id='parameters']/variablelist/varlistentry/term/parameter"))
+ .Cast<XElement>()
+ .Select(p =>
+ new DocumentationParameter(
+ p.Value.Trim(),
+ Cleanup(p.XPathSelectElement("../../listitem").Value)))
+ .ToList()
+ };
+
+ inline.Summary = Char.ToUpper(inline.Summary[0]) + inline.Summary.Substring(1);
+ return inline;
+ }
+
+ static readonly char[] newline = new char[] { '\n' };
+ static string Cleanup(string text)
+ {
+ return
+ String.Join(" ", text
+ .Replace("\r", "\n")
+ .Split(newline, StringSplitOptions.RemoveEmptyEntries)
+ .Select(s => s.Trim()).ToArray())
+ .Trim();
}
}
}
View
10 Source/Bind/ES/ES2Generator.cs
@@ -10,7 +10,7 @@
namespace Bind.ES
{
// Generation implementation for OpenGL ES 2.0 and 3.0
- class ES2Generator : ESGenerator
+ class ES2Generator : Generator
{
public ES2Generator(Settings settings, string dirName)
: base(settings, dirName)
@@ -22,9 +22,17 @@ public ES2Generator(Settings settings, string dirName)
Settings.DefaultDelegatesFile = "ES20Delegates.cs";
Settings.DefaultEnumsFile = "ES20Enums.cs";
Settings.DefaultWrappersFile = "ES20.cs";
+ Settings.DefaultDocPath = Path.Combine(
+ Settings.DefaultDocPath, "ES20");
Profile = "gles2";
Version = "2.0";
+
+ // For compatibility with OpenTK 1.0 and Xamarin, generate
+ // overloads using the "All" enum in addition to strongly-typed enums.
+ // This can be disabled by passing "-o:-keep_untyped_enums" as a cmdline parameter.
+ Settings.DefaultCompatibility |= Settings.Legacy.KeepUntypedEnums;
+ Settings.DefaultCompatibility |= Settings.Legacy.UseDllImports;
}
}
}
View
10 Source/Bind/ES/ES3Generator.cs
@@ -10,7 +10,7 @@
namespace Bind.ES
{
// Generation implementation for OpenGL ES 3.0
- class ES3Generator : ESGenerator
+ class ES3Generator : Generator
{
public ES3Generator(Settings settings, string dirName)
: base(settings, dirName)
@@ -22,9 +22,17 @@ public ES3Generator(Settings settings, string dirName)
Settings.DefaultDelegatesFile = "ES30Delegates.cs";
Settings.DefaultEnumsFile = "ES30Enums.cs";
Settings.DefaultWrappersFile = "ES30.cs";
+ Settings.DefaultDocPath = Path.Combine(
+ Settings.DefaultDocPath, "ES30");
Profile = "gles2"; // The 3.0 spec reuses the gles2 apiname
Version = "2.0|3.0";
+
+ // For compatibility with OpenTK 1.0 and Xamarin, generate
+ // overloads using the "All" enum in addition to strongly-typed enums.
+ // This can be disabled by passing "-o:-keep_untyped_enums" as a cmdline parameter.
+ Settings.DefaultCompatibility |= Settings.Legacy.KeepUntypedEnums;
+ Settings.DefaultCompatibility |= Settings.Legacy.UseDllImports;
}
}
}
View
2  Source/Bind/ES/ESGenerator.cs
@@ -22,6 +22,8 @@ public ESGenerator(Settings settings, string dirName)
Settings.DefaultDelegatesFile = "ES11Delegates.cs";
Settings.DefaultEnumsFile = "ES11Enums.cs";
Settings.DefaultWrappersFile = "ES11.cs";
+ Settings.DefaultDocPath = Path.Combine(
+ Settings.DefaultDocPath, "ES20"); // no ES11 docbook sources available
// Khronos releases a combined 1.0+1.1 specification,
// so we cannot distinguish between the two.
View
20 Source/Bind/FuncProcessor.cs
@@ -70,8 +70,8 @@ public FuncProcessor(IBind generator, string overrides)
Overrides = overrides;
}
- public FunctionCollection Process(EnumProcessor enum_processor, DelegateCollection delegates, EnumCollection enums,
- string apiname, string apiversion)
+ public FunctionCollection Process(EnumProcessor enum_processor, DocProcessor doc_processor,
+ DelegateCollection delegates, EnumCollection enums, string apiname, string apiversion)
{
Console.WriteLine("Processing delegates.");
var nav = new XPathDocument(Overrides).CreateNavigator();
@@ -131,11 +131,27 @@ public FuncProcessor(IBind generator, string overrides)
Console.WriteLine("Generating address table.");
GenerateAddressTable(delegates);
+ Console.WriteLine("Generating documentation.");
+ GenerateDocumentation(wrappers, enum_processor, doc_processor);
+
return wrappers;
}
#region Private Members
+ void GenerateDocumentation(FunctionCollection wrappers,
+ EnumProcessor enum_processor, DocProcessor doc_processor)
+ {
+ foreach (var list in wrappers)
+ {
+ foreach (var f in list.Value)
+ {
+ f.Documentation = doc_processor.Process(f,
+ enum_processor);
+ }
+ }
+ }
+
void GenerateAddressTable(DelegateCollection delegates)
{
int slot = -1;
View
61 Source/Bind/GL2/GL2Generator.cs
@@ -0,0 +1,61 @@
+#region License
+//
+// GL2Generator.cs
+//
+// Author:
+// Stefanos A. <stapostol@gmail.com>
+//
+// Copyright (c) 2006-2014 Stefanos Apostolopoulos
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+#endregion
+
+using System;
+using System.IO;
+
+namespace Bind.GL2
+{
+
+ class GL2Generator : Generator
+ {
+ public GL2Generator(Settings settings, string dirname)
+ : base(settings, dirname)
+ {
+ if (Settings.Compatibility == Settings.Legacy.Tao)
+ {
+ Settings.OutputNamespace = "Tao.OpenGl";
+ Settings.OutputClass = "Gl";
+ }
+ else
+ {
+ // Defaults
+ }
+
+ Settings.DefaultOutputNamespace = "OpenTK.Graphics.OpenGL";
+ Settings.DefaultImportsFile = "GLCore.cs";
+ Settings.DefaultDelegatesFile = "GLDelegates.cs";
+ Settings.DefaultEnumsFile = "GLEnums.cs";
+ Settings.DefaultWrappersFile = "GL.cs";
+ Settings.DefaultDocPath = Path.Combine(
+ Settings.DefaultDocPath, "GL");
+ }
+ }
+}
+
View
2  Source/Bind/GL2/GL4Generator.cs
@@ -45,6 +45,8 @@ public GL4Generator(Settings settings, string dirname)
Settings.DefaultDelegatesFile = "GL4Delegates.cs";
Settings.DefaultEnumsFile = "GL4Enums.cs";
Settings.DefaultWrappersFile = "GL4.cs";
+ Settings.DefaultDocPath = Path.Combine(
+ Settings.DefaultDocPath, "GL");
Profile = "glcore";
}
View
22 Source/Bind/GL2/Generator.cs
@@ -18,7 +18,7 @@
namespace Bind.GL2
{
- class Generator : IBind
+ abstract class Generator : IBind
{
#region Fields
@@ -82,22 +82,6 @@ public Generator(Settings settings, string dirName)
Settings.DelegatesClass = "Delegates";
Settings.OutputClass = "GL";
- if (Settings.Compatibility == Settings.Legacy.Tao)
- {
- Settings.OutputNamespace = "Tao.OpenGl";
- Settings.OutputClass = "Gl";
- }
- else
- {
- // Defaults
- }
-
- Settings.DefaultOutputNamespace = "OpenTK.Graphics.OpenGL";
- Settings.DefaultImportsFile = "GLCore.cs";
- Settings.DefaultDelegatesFile = "GLDelegates.cs";
- Settings.DefaultEnumsFile = "GLEnums.cs";
- Settings.DefaultWrappersFile = "GL.cs";
-
Delegates = new DelegateCollection();
Enums = new EnumCollection();
Wrappers = new FunctionCollection();
@@ -129,9 +113,11 @@ public virtual void Process()
var enum_processor = new EnumProcessor(this, overrides);
var func_processor = new FuncProcessor(this, overrides);
+ var doc_processor = new DocProcessor(this);
Enums = enum_processor.Process(Enums, Profile);
- Wrappers = func_processor.Process(enum_processor, Delegates, Enums, Profile, Version);
+ Wrappers = func_processor.Process(enum_processor, doc_processor,
+ Delegates, Enums, Profile, Version);
}
#endregion
View
795 Source/Bind/Generator.Bind.csproj
@@ -227,680 +227,6 @@
</None>
<None Include="Specifications\ES20\overrides.xml">
</None>
- <None Include="Specifications\Docs\glIsTexture.xml">
- </None>
- <None Include="Specifications\Docs\glXCreatePixmap.xml">
- </None>
- <None Include="Specifications\Docs\glViewport.xml">
- </None>
- <None Include="Specifications\Docs\glXDestroyContext.xml">
- </None>
- <None Include="Specifications\Docs\gluGetTessProperty.xml">
- </None>
- <None Include="Specifications\Docs\glEvalPoint.xml">
- </None>
- <None Include="Specifications\Docs\gluPerspective.xml">
- </None>
- <None Include="Specifications\Docs\glXDestroyPbuffer.xml">
- </None>
- <None Include="Specifications\Docs\glGetTexGen.xml">
- </None>
- <None Include="Specifications\Docs\glVertexPointer.xml">
- </None>
- <None Include="Specifications\Docs\glBlendFuncSeparate.xml">
- </None>
- <None Include="Specifications\Docs\glNormalPointer.xml">
- </None>
- <None Include="Specifications\Docs\glGetShader.xml">
- </None>
- <None Include="Specifications\Docs\gluBeginPolygon.xml">
- </None>
- <None Include="Specifications\Docs\glIsQuery.xml">
- </None>
- <None Include="Specifications\Docs\glResetHistogram.xml">
- </None>
- <None Include="Specifications\Docs\glXQueryExtensionsString.xml">
- </None>
- <None Include="Specifications\Docs\glLoadTransposeMatrix.xml">
- </None>
- <None Include="Specifications\Docs\glCompressedTexImage2D.xml">
- </None>
- <None Include="Specifications\Docs\glTexImage2D.xml">
- </None>
- <None Include="Specifications\Docs\glStencilOpSeparate.xml">
- </None>
- <None Include="Specifications\Docs\glDrawBuffer.xml">
- </None>
- <None Include="Specifications\Docs\glEdgeFlagPointer.xml">
- </None>
- <None Include="Specifications\Docs\glTexCoord.xml">
- </None>
- <None Include="Specifications\Docs\glMultiDrawElements.xml">
- </None>
- <None Include="Specifications\Docs\glEnableVertexAttribArray.xml">
- </None>
- <None Include="Specifications\Docs\glXGetProcAddress.xml">
- </None>
- <None Include="Specifications\Docs\glGenBuffers.xml">
- </None>
- <None Include="Specifications\Docs\glXFreeContextEXT.xml">
- </None>
- <None Include="Specifications\Docs\glFlush.xml">
- </None>
- <None Include="Specifications\Docs\glClearStencil.xml">
- </None>
- <None Include="Specifications\Docs\gluNextContour.xml">
- </None>
- <None Include="Specifications\Docs\glListBase.xml">
- </None>
- <None Include="Specifications\Docs\glGetColorTableParameter.xml">
- </None>
- <None Include="Specifications\Docs\glMapBuffer.xml">
- </None>
- <None Include="Specifications\Docs\glXDestroyGLXPixmap.xml">
- </None>
- <None Include="Specifications\Docs\glDrawElements.xml">
- </None>
- <None Include="Specifications\Docs\glPushMatrix.xml">
- </None>
- <None Include="Specifications\Docs\glVertexAttribPointer.xml">
- </None>
- <None Include="Specifications\Docs\glMultMatrix.xml">
- </None>
- <None Include="Specifications\Docs\glXGetClientString.xml">
- </None>
- <None Include="Specifications\Docs\glXGetContextIDEXT.xml">
- </None>
- <None Include="Specifications\Docs\gluLookAt.xml">
- </None>
- <None Include="Specifications\Docs\gluBuild3DMipmapLevels.xml">
- </None>
- <None Include="Specifications\Docs\glDrawRangeElements.xml">
- </None>
- <None Include="Specifications\Docs\glXGetFBConfigAttrib.xml">
- </None>
- <None Include="Specifications\Docs\glValidateProgram.xml">
- </None>
- <None Include="Specifications\Docs\glGetMap.xml">
- </None>
- <None Include="Specifications\Docs\glUniform.xml">
- </None>
- <None Include="Specifications\Docs\gluPwlCurve.xml">
- </None>
- <None Include="Specifications\Docs\glGetPointerv.xml">
- </None>
- <None Include="Specifications\Docs\glXDestroyPixmap.xml">
- </None>
- <None Include="Specifications\Docs\gluUnProject.xml">
- </None>
- <None Include="Specifications\Docs\glPrioritizeTextures.xml">
- </None>
- <None Include="Specifications\Docs\glCompressedTexSubImage2D.xml">
- </None>
- <None Include="Specifications\Docs\glGetQueryObject.xml">
- </None>
- <None Include="Specifications\Docs\glXCreateGLXPixmap.xml">
- </None>
- <None Include="Specifications\Docs\glBufferSubData.xml">
- </None>
- <None Include="Specifications\Docs\glClearDepth.xml">
- </None>
- <None Include="Specifications\Docs\glGetUniform.xml">
- </None>
- <None Include="Specifications\Docs\glEnable.xml">
- </None>
- <None Include="Specifications\Docs\glCopyColorTable.xml">
- </None>
- <None Include="Specifications\Docs\glTexImage1D.xml">
- </None>
- <None Include="Specifications\Docs\glPushClientAttrib.xml">
- </None>
- <None Include="Specifications\Docs\glBindBuffer.xml">
- </None>
- <None Include="Specifications\Docs\glEdgeFlag.xml">
- </None>
- <None Include="Specifications\Docs\gluDeleteTess.xml">
- </None>
- <None Include="Specifications\Docs\glVertexAttrib.xml">
- </None>
- <None Include="Specifications\Docs\glFog.xml">
- </None>
- <None Include="Specifications\Docs\glBeginQuery.xml">
- </None>
- <None Include="Specifications\Docs\glDrawPixels.xml">
- </None>
- <None Include="Specifications\Docs\glGetSeparableFilter.xml">
- </None>
- <None Include="Specifications\Docs\glGetConvolutionFilter.xml">
- </None>
- <None Include="Specifications\Docs\glXGetCurrentReadDrawable.xml">
- </None>
- <None Include="Specifications\Docs\glShaderSource.xml">
- </None>
- <None Include="Specifications\Docs\glPolygonOffset.xml">
- </None>
- <None Include="Specifications\Docs\glPushAttrib.xml">
- </None>
- <None Include="Specifications\Docs\glXQueryDrawable.xml">
- </None>
- <None Include="Specifications\Docs\glGetMinmax.xml">
- </None>
- <None Include="Specifications\Docs\gluScaleImage.xml">
- </None>
- <None Include="Specifications\Docs\glLineWidth.xml">
- </None>
- <None Include="Specifications\Docs\glRotate.xml">
- </None>
- <None Include="Specifications\Docs\glLight.xml">
- </None>
- <None Include="Specifications\Docs\glSelectBuffer.xml">
- </None>
- <None Include="Specifications\Docs\glFogCoord.xml">
- </None>
- <None Include="Specifications\Docs\glXGetSelectedEvent.xml">
- </None>
- <None Include="Specifications\Docs\glStencilMask.xml">
- </None>
- <None Include="Specifications\Docs\gluBuild2DMipmapLevels.xml">
- </None>
- <None Include="Specifications\Docs\glDepthRange.xml">
- </None>
- <None Include="Specifications\Docs\glReadBuffer.xml">
- </None>
- <None Include="Specifications\Docs\glDeleteBuffers.xml">
- </None>
- <None Include="Specifications\Docs\glGetBufferPointerv.xml">
- </None>
- <None Include="Specifications\Docs\glClearColor.xml">
- </None>
- <None Include="Specifications\Docs\glIsBuffer.xml">
- </None>
- <None Include="Specifications\Docs\glTexSubImage1D.xml">
- </None>
- <None Include="Specifications\Docs\glXGetCurrentContext.xml">
- </None>
- <None Include="Specifications\Docs\glIsList.xml">
- </None>
- <None Include="Specifications\Docs\glBlendEquation.xml">
- </None>
- <None Include="Specifications\Docs\glHint.xml">
- </None>
- <None Include="Specifications\Docs\glVertex.xml">
- </None>
- <None Include="Specifications\Docs\glTexSubImage3D.xml">
- </None>
- <None Include="Specifications\Docs\glCopyColorSubTable.xml">
- </None>
- <None Include="Specifications\Docs\gluNurbsCallback.xml">
- </None>
- <None Include="Specifications\Docs\gluNewQuadric.xml">
- </None>
- <None Include="Specifications\Docs\glUseProgram.xml">
- </None>
- <None Include="Specifications\Docs\glCullFace.xml">
- </None>
- <None Include="Specifications\Docs\glXGetCurrentDisplay.xml">
- </None>
- <None Include="Specifications\Docs\glSecondaryColor.xml">
- </None>
- <None Include="Specifications\Docs\glStencilFuncSeparate.xml">
- </None>
- <None Include="Specifications\Docs\gluPickMatrix.xml">
- </None>
- <None Include="Specifications\Docs\glGetTexParameter.xml">
- </None>
- <None Include="Specifications\Docs\glPixelZoom.xml">
- </None>
- <None Include="Specifications\Docs\gluBeginSurface.xml">
- </None>
- <None Include="Specifications\Docs\glGetVertexAttribPointerv.xml">
- </None>
- <None Include="Specifications\Docs\glClearAccum.xml">
- </None>
- <None Include="Specifications\Docs\glPushName.xml">
- </None>
- <None Include="Specifications\Docs\gluQuadricCallback.xml">
- </None>
- <None Include="Specifications\Docs\glCompileShader.xml">
- </None>
- <None Include="Specifications\Docs\gluDisk.xml">
- </None>
- <None Include="Specifications\Docs\gluCylinder.xml">
- </None>
- <None Include="Specifications\Docs\glBlendEquationSeparate.xml">
- </None>
- <None Include="Specifications\Docs\glPassThrough.xml">
- </None>
- <None Include="Specifications\Docs\glConvolutionFilter2D.xml">
- </None>
- <None Include="Specifications\Docs\glStencilOp.xml">
- </None>
- <None Include="Specifications\Docs\glScale.xml">
- </None>
- <None Include="Specifications\Docs\glXCreateWindow.xml">
- </None>
- <None Include="Specifications\Docs\glFogCoordPointer.xml">
- </None>
- <None Include="Specifications\Docs\glWindowPos.xml">
- </None>
- <None Include="Specifications\Docs\gluQuadricTexture.xml">
- </None>
- <None Include="Specifications\Docs\glAreTexturesResident.xml">
- </None>
- <None Include="Specifications\Docs\glXDestroyWindow.xml">
- </None>
- <None Include="Specifications\Docs\gluTessCallback.xml">
- </None>
- <None Include="Specifications\Docs\glDrawArrays.xml">
- </None>
- <None Include="Specifications\Docs\glMinmax.xml">
- </None>
- <None Include="Specifications\Docs\glArrayElement.xml">
- </None>
- <None Include="Specifications\Docs\glReadPixels.xml">
- </None>
- <None Include="Specifications\Docs\glGetLight.xml">
- </None>
- <None Include="Specifications\Docs\glTexEnv.xml">
- </None>
- <None Include="Specifications\Docs\glGetBufferParameteriv.xml">
- </None>
- <None Include="Specifications\Docs\glFrontFace.xml">
- </None>
- <None Include="Specifications\Docs\glCopyPixels.xml">
- </None>
- <None Include="Specifications\Docs\glXWaitX.xml">
- </None>
- <None Include="Specifications\Docs\glXQueryContext.xml">
- </None>
- <None Include="Specifications\Docs\gluTessEndPolygon.xml">
- </None>
- <None Include="Specifications\Docs\glEvalCoord.xml">
- </None>
- <None Include="Specifications\Docs\glLightModel.xml">
- </None>
- <None Include="Specifications\Docs\glXIsDirect.xml">
- </None>
- <None Include="Specifications\Docs\glMultiTexCoord.xml">
- </None>
- <None Include="Specifications\Docs\glXUseXFont.xml">
- </None>
- <None Include="Specifications\Docs\glBindAttribLocation.xml">
- </None>
- <None Include="Specifications\Docs\glTexImage3D.xml">
- </None>
- <None Include="Specifications\Docs\gluQuadricNormals.xml">
- </None>
- <None Include="Specifications\Docs\glClipPlane.xml">
- </None>
- <None Include="Specifications\Docs\glIndexPointer.xml">
- </None>
- <None Include="Specifications\Docs\glGetPixelMap.xml">
- </None>
- <None Include="Specifications\Docs\glXCreateContext.xml">
- </None>
- <None Include="Specifications\Docs\glCreateProgram.xml">
- </None>
- <None Include="Specifications\Docs\glCallLists.xml">
- </None>
- <None Include="Specifications\Docs\glTexCoordPointer.xml">
- </None>
- <None Include="Specifications\Docs\gluDeleteNurbsRenderer.xml">
- </None>
- <None Include="Specifications\Docs\glLogicOp.xml">
- </None>
- <None Include="Specifications\Docs\glLoadMatrix.xml">
- </None>
- <None Include="Specifications\Docs\glXIntro.xml">
- </None>
- <None Include="Specifications\Docs\gluBuild1DMipmaps.xml">
- </None>
- <None Include="Specifications\Docs\glIsProgram.xml">
- </None>
- <None Include="Specifications\Docs\glShadeModel.xml">
- </None>
- <None Include="Specifications\Docs\glBlendColor.xml">
- </None>
- <None Include="Specifications\Docs\glCallList.xml">
- </None>
- <None Include="Specifications\Docs\glBegin.xml">
- </None>
- <None Include="Specifications\Docs\glRenderMode.xml">
- </None>
- <None Include="Specifications\Docs\glXQueryVersion.xml">
- </None>
- <None Include="Specifications\Docs\glPolygonStipple.xml">
- </None>
- <None Include="Specifications\Docs\glDeleteQueries.xml">
- </None>
- <None Include="Specifications\Docs\glGetTexLevelParameter.xml">
- </None>
- <None Include="Specifications\Docs\glGetColorTable.xml">
- </None>
- <None Include="Specifications\Docs\gluBuild2DMipmaps.xml">
- </None>
- <None Include="Specifications\Docs\glColor.xml">
- </None>
- <None Include="Specifications\Docs\glAttachShader.xml">
- </None>
- <None Include="Specifications\Docs\glXGetVisualFromFBConfig.xml">
- </None>
- <None Include="Specifications\Docs\glXCreateNewContext.xml">
- </None>
- <None Include="Specifications\Docs\glBindTexture.xml">
- </None>
- <None Include="Specifications\Docs\glLoadName.xml">
- </None>
- <None Include="Specifications\Docs\glGenLists.xml">
- </None>
- <None Include="Specifications\Docs\gluNurbsProperty.xml">
- </None>
- <None Include="Specifications\Docs\glColorMask.xml">
- </None>
- <None Include="Specifications\Docs\glBufferData.xml">
- </None>
- <None Include="Specifications\Docs\gluQuadricDrawStyle.xml">
- </None>
- <None Include="Specifications\Docs\glGetActiveUniform.xml">
- </None>
- <None Include="Specifications\Docs\glSampleCoverage.xml">
- </None>
- <None Include="Specifications\Docs\glFeedbackBuffer.xml">
- </None>
- <None Include="Specifications\Docs\glCopyTexImage1D.xml">
- </None>
- <None Include="Specifications\Docs\glGetMaterial.xml">
- </None>
- <None Include="Specifications\Docs\glNewList.xml">
- </None>
- <None Include="Specifications\Docs\glNormal.xml">
- </None>
- <None Include="Specifications\Docs\glPointSize.xml">
- </None>
- <None Include="Specifications\Docs\glGenQueries.xml">
- </None>
- <None Include="Specifications\Docs\gluTessProperty.xml">
- </None>
- <None Include="Specifications\Docs\glIsShader.xml">
- </None>
- <None Include="Specifications\Docs\gluGetString.xml">
- </None>
- <None Include="Specifications\Docs\glTexGen.xml">
- </None>
- <None Include="Specifications\Docs\glDepthMask.xml">
- </None>
- <None Include="Specifications\Docs\glGetProgramInfoLog.xml">
- </None>
- <None Include="Specifications\Docs\gluOrtho2D.xml">
- </None>
- <None Include="Specifications\Docs\glXChooseFBConfig.xml">
- </None>
- <None Include="Specifications\Docs\glSeparableFilter2D.xml">
- </None>
- <None Include="Specifications\Docs\glDeleteProgram.xml">
- </None>
- <None Include="Specifications\Docs\gluErrorString.xml">
- </None>
- <None Include="Specifications\Docs\gluNewTess.xml">
- </None>
- <None Include="Specifications\Docs\gluUnProject4.xml">
- </None>
- <None Include="Specifications\Docs\glXChooseVisual.xml">
- </None>
- <None Include="Specifications\Docs\glGetHistogram.xml">
- </None>
- <None Include="Specifications\Docs\glEnableClientState.xml">
- </None>
- <None Include="Specifications\Docs\gluNewNurbsRenderer.xml">
- </None>
- <None Include="Specifications\Docs\glXGetFBConfigs.xml">
- </None>
- <None Include="Specifications\Docs\glXSwapBuffers.xml">
- </None>
- <None Include="Specifications\Docs\glBitmap.xml">
- </None>
- <None Include="Specifications\Docs\glLineStipple.xml">
- </None>
- <None Include="Specifications\Docs\glGetCompressedTexImage.xml">
- </None>
- <None Include="Specifications\Docs\gluBeginTrim.xml">
- </None>
- <None Include="Specifications\Docs\glCopyConvolutionFilter1D.xml">
- </None>
- <None Include="Specifications\Docs\glCreateShader.xml">
- </None>
- <None Include="Specifications\Docs\glGetHistogramParameter.xml">
- </None>
- <None Include="Specifications\Docs\gluQuadricOrientation.xml">
- </None>
- <None Include="Specifications\Docs\glFinish.xml">
- </None>
- <None Include="Specifications\Docs\glXQueryExtension.xml">
- </None>
- <None Include="Specifications\Docs\glGetString.xml">
- </None>
- <None Include="Specifications\Docs\glCompressedTexImage3D.xml">
- </None>
- <None Include="Specifications\Docs\glStencilFunc.xml">
- </None>
- <None Include="Specifications\Docs\glGetShaderSource.xml">
- </None>
- <None Include="Specifications\Docs\gluPartialDisk.xml">
- </None>
- <None Include="Specifications\Docs\glColorMaterial.xml">
- </None>
- <None Include="Specifications\Docs\glGetAttribLocation.xml">
- </None>
- <None Include="Specifications\Docs\glGetPolygonStipple.xml">
- </None>
- <None Include="Specifications\Docs\glScissor.xml">
- </None>
- <None Include="Specifications\Docs\gluTessBeginContour.xml">
- </None>
- <None Include="Specifications\Docs\glGetMinmaxParameter.xml">
- </None>
- <None Include="Specifications\Docs\glClientActiveTexture.xml">
- </None>
- <None Include="Specifications\Docs\glCopyTexSubImage2D.xml">
- </None>
- <None Include="Specifications\Docs\gluProject.xml">
- </None>
- <None Include="Specifications\Docs\glDeleteTextures.xml">
- </None>
- <None Include="Specifications\Docs\gluGetNurbsProperty.xml">
- </None>
- <None Include="Specifications\Docs\glResetMinmax.xml">
- </None>
- <None Include="Specifications\Docs\glMapGrid.xml">
- </None>
- <None Include="Specifications\Docs\gluSphere.xml">
- </None>
- <None Include="Specifications\Docs\glActiveTexture.xml">
- </None>
- <None Include="Specifications\Docs\glXWaitGL.xml">
- </None>
- <None Include="Specifications\Docs\glGet.xml">
- </None>
- <None Include="Specifications\Docs\glDepthFunc.xml">
- </None>
- <None Include="Specifications\Docs\glMap2.xml">
- </None>
- <None Include="Specifications\Docs\gluTessVertex.xml">
- </None>
- <None Include="Specifications\Docs\glBlendFunc.xml">
- </None>
- <None Include="Specifications\Docs\glMultTransposeMatrix.xml">
- </None>
- <None Include="Specifications\Docs\glMultiDrawArrays.xml">
- </None>
- <None Include="Specifications\Docs\glColorTableParameter.xml">
- </None>
- <None Include="Specifications\Docs\glXMakeContextCurrent.xml">
- </None>
- <None Include="Specifications\Docs\glPointParameter.xml">
- </None>
- <None Include="Specifications\Docs\glMaterial.xml">
- </None>
- <None Include="Specifications\Docs\glColorSubTable.xml">
- </None>
- <None Include="Specifications\Docs\glGetQueryiv.xml">
- </None>
- <None Include="Specifications\Docs\glCopyConvolutionFilter2D.xml">
- </None>
- <None Include="Specifications\Docs\glXCreatePbuffer.xml">
- </None>
- <None Include="Specifications\Docs\glClearIndex.xml">
- </None>
- <None Include="Specifications\Docs\gluTessBeginPolygon.xml">
- </None>
- <None Include="Specifications\Docs\gluBuild1DMipmapLevels.xml">
- </None>
- <None Include="Specifications\Docs\glXGetCurrentDrawable.xml">
- </None>
- <None Include="Specifications\Docs\glLinkProgram.xml">
- </None>
- <None Include="Specifications\Docs\gluNurbsCallbackDataEXT.xml">
- </None>
- <None Include="Specifications\Docs\glXQueryServerString.xml">
- </None>
- <None Include="Specifications\Docs\gluNurbsCallbackData.xml">
- </None>
- <None Include="Specifications\Docs\glClear.xml">
- </None>
- <None Include="Specifications\Docs\glTexSubImage2D.xml">
- </None>
- <None Include="Specifications\Docs\glColorPointer.xml">
- </None>
- <None Include="Specifications\Docs\gluBuild3DMipmaps.xml">
- </None>
- <None Include="Specifications\Docs\glGetActiveAttrib.xml">
- </None>
- <None Include="Specifications\Docs\glGetTexEnv.xml">
- </None>
- <None Include="Specifications\Docs\glCompressedTexImage1D.xml">
- </None>
- <None Include="Specifications\Docs\glConvolutionFilter1D.xml">
- </None>
- <None Include="Specifications\Docs\glXGetConfig.xml">
- </None>
- <None Include="Specifications\Docs\glCompressedTexSubImage1D.xml">
- </None>
- <None Include="Specifications\Docs\glAccum.xml">
- </None>
- <None Include="Specifications\Docs\glPolygonMode.xml">
- </None>
- <None Include="Specifications\Docs\gluCheckExtension.xml">
- </None>
- <None Include="Specifications\Docs\glGetVertexAttrib.xml">
- </None>
- <None Include="Specifications\Docs\glXImportContextEXT.xml">
- </None>
- <None Include="Specifications\Docs\glPixelMap.xml">
- </None>
- <None Include="Specifications\Docs\glGetShaderInfoLog.xml">
- </None>
- <None Include="Specifications\Docs\glStencilMaskSeparate.xml">
- </None>
- <None Include="Specifications\Docs\glTranslate.xml">
- </None>
- <None Include="Specifications\Docs\glMap1.xml">
- </None>
- <None Include="Specifications\Docs\glCopyTexSubImage1D.xml">
- </None>
- <None Include="Specifications\Docs\glColorTable.xml">
- </None>
- <None Include="Specifications\Docs\gluNurbsSurface.xml">
- </None>
- <None Include="Specifications\Docs\glDeleteLists.xml">
- </None>
- <None Include="Specifications\Docs\glRect.xml">
- </None>
- <None Include="Specifications\Docs\glSecondaryColorPointer.xml">
- </None>
- <None Include="Specifications\Docs\glEvalMesh.xml">
- </None>
- <None Include="Specifications\Docs\glXSelectEvent.xml">
- </None>
- <None Include="Specifications\Docs\glPixelStore.xml">
- </None>
- <None Include="Specifications\Docs\glGenTextures.xml">
- </None>
- <None Include="Specifications\Docs\gluDeleteQuadric.xml">
- </None>
- <None Include="Specifications\Docs\glXCopyContext.xml">
- </None>
- <None Include="Specifications\Docs\glGetBufferSubData.xml">
- </None>
- <None Include="Specifications\Docs\glGetClipPlane.xml">
- </None>
- <None Include="Specifications\Docs\glGetTexImage.xml">
- </None>
- <None Include="Specifications\Docs\glCopyTexImage2D.xml">
- </None>
- <None Include="Specifications\Docs\glGetConvolutionParameter.xml">
- </None>
- <None Include="Specifications\Docs\glXQueryContextInfoEXT.xml">
- </None>
- <None Include="Specifications\Docs\glPixelTransfer.xml">
- </None>
- <None Include="Specifications\Docs\glRasterPos.xml">
- </None>
- <None Include="Specifications\Docs\glDrawBuffers.xml">
- </None>
- <None Include="Specifications\Docs\glLoadIdentity.xml">
- </None>
- <None Include="Specifications\Docs\glCopyTexSubImage3D.xml">
- </None>
- <None Include="Specifications\Docs\gluBeginCurve.xml">
- </None>
- <None Include="Specifications\Docs\glXMakeCurrent.xml">
- </None>
- <None Include="Specifications\Docs\glIsEnabled.xml">
- </None>
- <None Include="Specifications\Docs\gluTessNormal.xml">
- </None>
- <None Include="Specifications\Docs\glGetAttachedShaders.xml">
- </None>
- <None Include="Specifications\Docs\glFrustum.xml">
- </None>
- <None Include="Specifications\Docs\gluLoadSamplingMatrices.xml">
- </None>
- <None Include="Specifications\Docs\glMatrixMode.xml">
- </None>
- <None Include="Specifications\Docs\glGetUniformLocation.xml">
- </None>
- <None Include="Specifications\Docs\glGetProgram.xml">
- </None>
- <None Include="Specifications\Docs\glHistogram.xml">
- </None>
- <None Include="Specifications\Docs\glConvolutionParameter.xml">
- </None>
- <None Include="Specifications\Docs\glInterleavedArrays.xml">
- </None>
- <None Include="Specifications\Docs\glCompressedTexSubImage3D.xml">
- </None>
- <None Include="Specifications\Docs\glGetError.xml">
- </None>
- <None Include="Specifications\Docs\glDeleteShader.xml">
- </None>
- <None Include="Specifications\Docs\glAlphaFunc.xml">
- </None>
- <None Include="Specifications\Docs\glOrtho.xml">
- </None>
- <None Include="Specifications\Docs\glDetachShader.xml">
- </None>
- <None Include="Specifications\Docs\gluNurbsCurve.xml">
- </None>
- <None Include="Specifications\Docs\glInitNames.xml">
- </None>
- <None Include="Specifications\Docs\glIndexMask.xml">
- </None>
- <None Include="Specifications\Docs\glTexParameter.xml">
- </None>
- <None Include="Specifications\Docs\glIndex.xml">
- </None>
- <None Include="Specifications\Docs\ToInlineDocs.xslt">
- </None>
<None Include="Documentation\todo.txt">
</None>
<None Include="Documentation\changelog.txt">
@@ -914,124 +240,10 @@
<Compile Include="ES\ES3Generator.cs">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="GL2\GL2Generator.cs" />
+ <Compile Include="Structures\Documentation.cs" />
</ItemGroup>
<ItemGroup>
- <None Include="Specifications\Docs\glActiveShaderProgram.xml" />
- <None Include="Specifications\Docs\glBeginConditionalRender.xml" />
- <None Include="Specifications\Docs\glBeginQueryIndexed.xml" />
- <None Include="Specifications\Docs\glBeginTransformFeedback.xml" />
- <None Include="Specifications\Docs\glBindBufferBase.xml" />
- <None Include="Specifications\Docs\glBindBufferRange.xml" />
- <None Include="Specifications\Docs\glBindFragDataLocation.xml" />
- <None Include="Specifications\Docs\glBindFragDataLocationIndexed.xml" />
- <None Include="Specifications\Docs\glBindFramebuffer.xml" />
- <None Include="Specifications\Docs\glBindProgramPipeline.xml" />
- <None Include="Specifications\Docs\glBindRenderbuffer.xml" />
- <None Include="Specifications\Docs\glBindSampler.xml" />
- <None Include="Specifications\Docs\glBindTransformFeedback.xml" />
- <None Include="Specifications\Docs\glBindVertexArray.xml" />
- <None Include="Specifications\Docs\glBlitFramebuffer.xml" />
- <None Include="Specifications\Docs\glCheckFramebufferStatus.xml" />
- <None Include="Specifications\Docs\glClampColor.xml" />
- <None Include="Specifications\Docs\glClearBuffer.xml" />
- <None Include="Specifications\Docs\glClientWaitSync.xml" />
- <None Include="Specifications\Docs\glCopyBufferSubData.xml" />
- <None Include="Specifications\Docs\glCreateShaderProgram.xml" />
- <None Include="Specifications\Docs\glDeleteFramebuffers.xml" />
- <None Include="Specifications\Docs\glDeleteProgramPipelines.xml" />
- <None Include="Specifications\Docs\glDeleteRenderbuffers.xml" />
- <None Include="Specifications\Docs\glDeleteSamplers.xml" />
- <None Include="Specifications\Docs\glDeleteSync.xml" />
- <None Include="Specifications\Docs\glDeleteTransformFeedbacks.xml" />
- <None Include="Specifications\Docs\glDeleteVertexArrays.xml" />
- <None Include="Specifications\Docs\glDepthRangeArray.xml" />
- <None Include="Specifications\Docs\glDepthRangeIndexed.xml" />
- <None Include="Specifications\Docs\glDrawArraysIndirect.xml" />
- <None Include="Specifications\Docs\glDrawArraysInstanced.xml" />
- <None Include="Specifications\Docs\glDrawElementsBaseVertex.xml" />
- <None Include="Specifications\Docs\glDrawElementsIndirect.xml" />
- <None Include="Specifications\Docs\glDrawElementsInstanced.xml" />
- <None Include="Specifications\Docs\glDrawElementsInstancedBaseVertex.xml" />
- <None Include="Specifications\Docs\glDrawRangeElementsBaseVertex.xml" />
- <None Include="Specifications\Docs\glDrawTransformFeedback.xml" />
- <None Include="Specifications\Docs\glDrawTransformFeedbackStream.xml" />
- <None Include="Specifications\Docs\glFenceSync.xml" />
- <None Include="Specifications\Docs\glFlushMappedBufferRange.xml" />
- <None Include="Specifications\Docs\glFramebufferRenderbuffer.xml" />
- <None Include="Specifications\Docs\glFramebufferTexture.xml" />
- <None Include="Specifications\Docs\glFramebufferTextureFace.xml" />
- <None Include="Specifications\Docs\glFramebufferTextureLayer.xml" />
- <None Include="Specifications\Docs\glGenerateMipmap.xml" />
- <None Include="Specifications\Docs\glGenFramebuffers.xml" />
- <None Include="Specifications\Docs\glGenProgramPipelines.xml" />
- <None Include="Specifications\Docs\glGenRenderbuffers.xml" />
- <None Include="Specifications\Docs\glGenSamplers.xml" />
- <None Include="Specifications\Docs\glGenTransformFeedbacks.xml" />
- <None Include="Specifications\Docs\glGenVertexArrays.xml" />
- <None Include="Specifications\Docs\glGetActiveSubroutineName.xml" />
- <None Include="Specifications\Docs\glGetActiveSubroutineUniform.xml" />
- <None Include="Specifications\Docs\glGetActiveSubroutineUniformName.xml" />
- <None Include="Specifications\Docs\glGetActiveUniformBlock.xml" />
- <None Include="Specifications\Docs\glGetActiveUniformBlockName.xml" />
- <None Include="Specifications\Docs\glGetActiveUniformName.xml" />
- <None Include="Specifications\Docs\glGetBufferParameter.xml" />
- <None Include="Specifications\Docs\glGetFragDataIndex.xml" />
- <None Include="Specifications\Docs\glGetFragDataLocation.xml" />
- <None Include="Specifications\Docs\glGetFramebufferAttachmentParameter.xml" />
- <None Include="Specifications\Docs\glGetMultisample.xml" />
- <None Include="Specifications\Docs\glGetProgramBinary.xml" />
- <None Include="Specifications\Docs\glGetProgramPipeline.xml" />
- <None Include="Specifications\Docs\glGetProgramPipelineInfoLog.xml" />
- <None Include="Specifications\Docs\glGetProgramStage.xml" />
- <None Include="Specifications\Docs\glGetQueryIndexed.xml" />
- <None Include="Specifications\Docs\glGetRenderbufferParameter.xml" />
- <None Include="Specifications\Docs\glGetSamplerParameter.xml" />
- <None Include="Specifications\Docs\glGetShaderPrecisionFormat.xml" />
- <None Include="Specifications\Docs\glGetSubroutineIndex.xml" />
- <None Include="Specifications\Docs\glGetSubroutineUniformLocation.xml" />
- <None Include="Specifications\Docs\glGetSync.xml" />
- <None Include="Specifications\Docs\glGetTransformFeedbackVarying.xml" />
- <None Include="Specifications\Docs\glGetUniformBlockIndex.xml" />
- <None Include="Specifications\Docs\glGetUniformIndices.xml" />
- <None Include="Specifications\Docs\glGetUniformSubroutine.xml" />
- <None Include="Specifications\Docs\glIsFramebuffer.xml" />
- <None Include="Specifications\Docs\glIsProgramPipeline.xml" />
- <None Include="Specifications\Docs\glIsRenderbuffer.xml" />
- <None Include="Specifications\Docs\glIsSampler.xml" />
- <None Include="Specifications\Docs\glIsSync.xml" />
- <None Include="Specifications\Docs\glIsTransformFeedback.xml" />
- <None Include="Specifications\Docs\glIsVertexArray.xml" />
- <None Include="Specifications\Docs\glMapBufferRange.xml" />
- <None Include="Specifications\Docs\glMultiDrawElementsBaseVertex.xml" />
- <None Include="Specifications\Docs\glPatchParameter.xml" />
- <None Include="Specifications\Docs\glPauseTransformFeedback.xml" />
- <None Include="Specifications\Docs\glPrimitiveRestartIndex.xml" />
- <None Include="Specifications\Docs\glProgramBinary.xml" />
- <None Include="Specifications\Docs\glProgramParameter.xml" />
- <None Include="Specifications\Docs\glProgramUniform.xml" />
- <None Include="Specifications\Docs\glProvokingVertex.xml" />
- <None Include="Specifications\Docs\glQueryCounter.xml" />
- <None Include="Specifications\Docs\glReleaseShaderCompiler.xml" />
- <None Include="Specifications\Docs\glRenderbufferStorage.xml" />
- <None Include="Specifications\Docs\glRenderbufferStorageMultisample.xml" />
- <None Include="Specifications\Docs\glResumeTransformFeedback.xml" />
- <None Include="Specifications\Docs\glSampleMaski.xml" />
- <None Include="Specifications\Docs\glSamplerParameter.xml" />
- <None Include="Specifications\Docs\glScissorArray.xml" />
- <None Include="Specifications\Docs\glScissorIndexed.xml" />
- <None Include="Specifications\Docs\glShaderBinary.xml" />
- <None Include="Specifications\Docs\glTexBuffer.xml" />
- <None Include="Specifications\Docs\glTexImage2DMultisample.xml" />
- <None Include="Specifications\Docs\glTexImage3DMultisample.xml" />
- <None Include="Specifications\Docs\glTransformFeedbackVaryings.xml" />
- <None Include="Specifications\Docs\glUniformBlockBinding.xml" />
- <None Include="Specifications\Docs\glUniformSubroutines.xml" />
- <None Include="Specifications\Docs\glUseProgramStages.xml" />
- <None Include="Specifications\Docs\glValidateProgramPipeline.xml" />
- <None Include="Specifications\Docs\glVertexAttribDivisor.xml" />
- <None Include="Specifications\Docs\glViewportArray.xml" />
- <None Include="Specifications\Docs\glViewportIndexed.xml" />
- <None Include="Specifications\Docs\glWaitSync.xml" />
<None Include="Specifications\GL2\signatures.xml">
<SubType>Designer</SubType>
</None>
@@ -1057,4 +269,7 @@
</Properties>
</MonoDevelop>
</ProjectExtensions>
+ <ItemGroup>
+ <Folder Include="Specifications\Docs\" />
+ </ItemGroup>
</Project>
View
63 Source/Bind/JavaSpecWriter.cs
@@ -41,7 +41,6 @@ namespace Bind
sealed class JavaSpecWriter : ISpecWriter
{
- readonly char[] numbers = "0123456789".ToCharArray();
const string DigitPrefix = "T"; // Prefix for identifiers that start with a digit
const string OutputFileHeader = "GL.java";
@@ -316,60 +315,24 @@ private static string GenerateReturnParameterString(Function f)
return f.ReturnType.CurrentType;
}
- DocProcessor processor_;
- DocProcessor Processor
- {
- get
- {
- if (processor_ == null)
- processor_ = new DocProcessor(Path.Combine(Settings.DocPath, Settings.DocFile));
- return processor_;
- }
- }
- Dictionary<string, string> docfiles;
void WriteDocumentation(BindStreamWriter sw, Function f)
{
- if (docfiles == null)
- {
- docfiles = new Dictionary<string, string>();
- foreach (string file in Directory.GetFiles(Settings.DocPath))
- {
- docfiles.Add(Path.GetFileName(file), file);
- }
- }
+ var docs = f.Documentation;
- string docfile = null;
try
{
- docfile = Settings.FunctionPrefix + f.WrappedDelegate.Name + ".xml";
- if (!docfiles.ContainsKey(docfile))
- docfile = Settings.FunctionPrefix + f.TrimmedName + ".xml";
- if (!docfiles.ContainsKey(docfile))
- docfile = Settings.FunctionPrefix + f.TrimmedName.TrimEnd(numbers) + ".xml";
-
- var docs = new List<string>();
- if (docfiles.ContainsKey(docfile))
- {
- docs.AddRange(Processor.ProcessFile(docfiles[docfile]));
- }
- if (docs.Count == 0)
- {
- docs.Add("/// <summary></summary>");
- }
-
- int summary_start = docs[0].IndexOf("<summary>") + "<summary>".Length;
string warning = "[deprecated: v{0}]";
string category = "[requires: {0}]";
if (f.Deprecated)
{
warning = String.Format(warning, f.DeprecatedVersion);
- docs[0] = docs[0].Insert(summary_start, warning);
+ docs.Summary = docs.Summary.Insert(0, warning);
}
if (f.Extension != "Core" && !String.IsNullOrEmpty(f.Category))
{
category = String.Format(category, f.Category);
- docs[0] = docs[0].Insert(summary_start, category);
+ docs.Summary = docs.Summary.Insert(0, category);
}
else if (!String.IsNullOrEmpty(f.Version))
{
@@ -377,17 +340,29 @@ void WriteDocumentation(BindStreamWriter sw, Function f)
category = String.Format(category, "v" + f.Version);
else
category = String.Format(category, "v" + f.Version + " and " + f.Category);
- docs[0] = docs[0].Insert(summary_start, category);
+ docs.Summary = docs.Summary.Insert(0, category);
+ }
+
+ for (int i = 0; i < f.WrappedDelegate.Parameters.Count; i++)
+ {
+ var param = f.WrappedDelegate.Parameters[i];
+ if (param.ComputeSize != String.Empty)
+ {
+ docs.Parameters[i].Documentation.Insert(0,
+ String.Format("[length: {0}]", param.ComputeSize));
+ }
}
- foreach (var doc in docs)
+ sw.WriteLine("/// <summary>{0}</summary>", docs.Summary);
+ foreach (var p in docs.Parameters)
{
- sw.WriteLine(doc);
+ sw.WriteLine("/// <param name=\"{0}\">{1}</param>", p.Name, p.Documentation);
}
}
catch (Exception e)
{
- Console.WriteLine("[Warning] Error processing file {0}: {1}", docfile, e.ToString());
+ Console.WriteLine("[Warning] Error documenting function {0}: {1}",
+ f.WrappedDelegate.Name, e.ToString());
}
}
View
4 Source/Bind/Main.cs
@@ -187,7 +187,7 @@ static void Main(string[] arguments)
case GeneratorMode.All:
Console.WriteLine("Using 'all' generator mode.");
Console.WriteLine("Use '-mode:all/gl2/gl4/es10/es11/es20/es30' to select a specific mode.");
- Generators.Add(new Generator(Settings, dirName));
+ Generators.Add(new GL2Generator(Settings, dirName));
Generators.Add(new GL4Generator(Settings, dirName));
Generators.Add(new ESGenerator(Settings, dirName));
Generators.Add(new ES2Generator(Settings, dirName));
@@ -195,7 +195,7 @@ static void Main(string[] arguments)
break;
case GeneratorMode.GL2:
- Generators.Add(new Generator(Settings, dirName));
+ Generators.Add(new GL2Generator(Settings, dirName));
break;
case GeneratorMode.GL3:
View
6 Source/Bind/Settings.cs
@@ -23,7 +23,7 @@ public Settings()
public string DefaultOutputPath = "../../../Source/OpenTK/Graphics/OpenGL";
public string DefaultOutputNamespace = "OpenTK.Graphics.OpenGL";
public string DefaultDocPath = "../../../Source/Bind/Specifications/Docs";
- public string DefaultDocFile = "ToInlineDocs.xslt";
+ public string DefaultFallbackDocPath = "../../../Source/Bind/Specifications/Docs/GL";
public string DefaultLicenseFile = "License.txt";
public string DefaultOverridesFile = "GL2/gloverrides.xml";
public string DefaultLanguageTypeMapFile = "csharp.tm";
@@ -34,7 +34,7 @@ public Settings()
public string DefaultWrappersFile = "GL.cs";
public Legacy DefaultCompatibility = Legacy.NoDropMultipleTokens;
- string inputPath, outputPath, outputNamespace, docPath, docFile, licenseFile, overridesFile,
+ string inputPath, outputPath, outputNamespace, docPath, fallbackDocPath, licenseFile, overridesFile,
languageTypeMapFile, keywordEscapeCharacter, importsFile, delegatesFile, enumsFile,
wrappersFile;
Nullable<Legacy> compatibility;
@@ -42,7 +42,7 @@ public Settings()
public string OutputPath { get { return outputPath ?? DefaultOutputPath; } set { outputPath = value; } }
public string OutputNamespace { get { return outputNamespace ?? DefaultOutputNamespace; } set { outputNamespace = value; } }
public string DocPath { get { return docPath ?? DefaultDocPath; } set { docPath = value; } }
- public string DocFile { get { return docFile ?? DefaultDocFile; } set { docFile = value; } }
+ public string FallbackDocPath { get { return fallbackDocPath ?? DefaultFallbackDocPath; } set { fallbackDocPath = value; } }
public string LicenseFile { get { return licenseFile ?? DefaultLicenseFile; } set { licenseFile = value; } }
public string OverridesFile { get { return overridesFile ?? DefaultOverridesFile; } set { overridesFile = value; } }
public string LanguageTypeMapFile { get { return languageTypeMapFile ?? DefaultLanguageTypeMapFile; } set { languageTypeMapFile = value; } }
View
78 Source/Bind/Specifications/Docs/ES20/glActiveTexture.xml
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
+ "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
+<refentry id="glActiveTexture">
+ <refmeta>
+ <refmetainfo>
+ <copyright>
+ <year>1991-2006</year>
+ <holder>Silicon Graphics, Inc.</holder>
+ </copyright>
+ </refmetainfo>
+ <refentrytitle>glActiveTexture</refentrytitle>
+ <manvolnum>3G</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>glActiveTexture</refname>
+ <refpurpose>select active texture unit</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv><title>C Specification</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>void <function>glActiveTexture</function></funcdef>
+ <paramdef>GLenum <parameter>texture</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <!-- eqn: ignoring delim $$ -->
+ <refsect1 id="parameters"><title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term><parameter>texture</parameter></term>
+ <listitem>
+ <para>
+ Specifies which texture unit to make active. The number
+ of texture units is implementation dependent, but must be at least
+ 8. <parameter>texture</parameter> must be one of
+ <constant>GL_TEXTURE</constant><inlineequation><mml:math><mml:mi mathvariant="italic">i</mml:mi></mml:math></inlineequation>,
+ where
+ i ranges from 0 to (<constant>GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS</constant> - 1).
+ The initial value is <constant>GL_TEXTURE0</constant>.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1 id="description"><title>Description</title>
+ <para>
+ <function>glActiveTexture</function> selects which texture unit subsequent texture state calls will
+ affect. The number of texture units an implementation supports is
+ implementation dependent, but must be at least 8.
+ </para>
+ </refsect1>
+ <refsect1 id="errors"><title>Errors</title>
+ <para>
+ <constant>GL_INVALID_ENUM</constant> is generated if <parameter>texture</parameter> is not one of
+ <constant>GL_TEXTURE</constant><inlineequation><mml:math><mml:mi mathvariant="italic">i</mml:mi></mml:math></inlineequation>,
+ where i ranges from 0 to (<constant>GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS</constant> - 1).
+ </para>
+ </refsect1>
+ <refsect1 id="associatedgets"><title>Associated Gets</title>
+ <para>
+ <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_ACTIVE_TEXTURE</constant> or <constant>GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS</constant>
+ </para>
+ </refsect1>
+ <refsect1 id="seealso"><title>See Also</title>
+ <para>
+ <citerefentry><refentrytitle>glTexParameter</refentrytitle></citerefentry>
+ </para>
+ </refsect1>
+ <refsect1 id="copyright"><title>Copyright</title>
+ <para>
+ Copyright <trademark class="copyright"></trademark> 1991-2006
+ Silicon Graphics, Inc. This document is licensed under the SGI
+ Free Software B License. For details, see
+ <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>.
+ </para>
+ </refsect1>
+</refentry>
View
107 Source/Bind/Specifications/Docs/ES20/glAttachShader.xml
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
+ "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
+<refentry id="glAttachShader">
+ <refmeta>
+ <refentrytitle>glAttachShader</refentrytitle>
+ <manvolnum>3G</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>glAttachShader</refname>
+ <refpurpose>attach a shader object to a program object</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv><title>C Specification</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>void <function>glAttachShader</function></funcdef>
+ <paramdef>GLuint <parameter>program</parameter></paramdef>
+ <paramdef>GLuint <parameter>shader</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1 id="parameters"><title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term><parameter>program</parameter></term>
+ <listitem>
+ <para>Specifies the program object to which a shader
+ object will be attached.</para>
+ </listitem>
+
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>shader</parameter></term>
+ <listitem>
+ <para>Specifies the shader object that is to be attached.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1 id="description"><title>Description</title>
+ <para>In order to create an executable, there must be a way to
+ specify the list of things that will be linked together. Program
+ objects provide this mechanism. Shaders that are to be linked
+ together in a program object must first be attached to that
+ program object. <function>glAttachShader</function> attaches the
+ shader object specified by <parameter>shader</parameter> to the
+ program object specified by <parameter>program</parameter>. This
+ indicates that <parameter>shader</parameter> will be included in
+ link operations that will be performed on
+ <parameter>program</parameter>.</para>
+
+ <para>All operations that can be performed on a shader object
+ are valid whether or not the shader object is attached to a
+ program object. It is permissible to attach a shader object to a
+ program object before source code has been loaded into the
+ shader object or before the shader object has been compiled.
+ Multiple shader objects of the same type may not be attached to
+ a single program object. However, a single shader object may be
+ attached to more than one program object.
+ If a shader object is deleted while it is
+ attached to a program object, it will be flagged for deletion,
+ and deletion will not occur until
+ <citerefentry><refentrytitle>glDetachShader</refentrytitle></citerefentry>
+ is called to detach it from all program objects to which it is
+ attached.</para>
+ </refsect1>
+ <refsect1 id="errors"><title>Errors</title>
+ <para><constant>GL_INVALID_VALUE</constant> is generated if either
+ <parameter>program</parameter> or <parameter>shader</parameter>
+ is not a value generated by OpenGL.</para>
+
+ <para><constant>GL_INVALID_OPERATION</constant> is generated if
+ <parameter>program</parameter> is not a program object.</para>
+
+ <para><constant>GL_INVALID_OPERATION</constant> is generated if
+ <parameter>shader</parameter> is not a shader object.</para>
+
+ <para><constant>GL_INVALID_OPERATION</constant> is generated if
+ <parameter>shader</parameter> is already attached to
+ <parameter>program</parameter>, or if another shader object of
+ the same type as <parameter>shader</parameter> is already attached
+ to <parameter>program</parameter>.</para>
+ </refsect1>
+ <refsect1 id="associatedgets"><title>Associated Gets</title>
+ <para><citerefentry><refentrytitle>glGetAttachedShaders</refentrytitle></citerefentry>
+ with the handle of a valid program object</para>
+
+ <para><citerefentry><refentrytitle>glIsProgram</refentrytitle></citerefentry></para>
+
+ <para><citerefentry><refentrytitle>glIsShader</refentrytitle></citerefentry></para>
+ </refsect1>
+ <refsect1 id="seealso"><title>See Also</title>
+ <para><citerefentry><refentrytitle>glCompileShader</refentrytitle></citerefentry>,
+ <citerefentry><refentrytitle>glDetachShader</refentrytitle></citerefentry>,
+ <citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>,
+ <citerefentry><refentrytitle>glShaderSource</refentrytitle></citerefentry>,
+ <citerefentry><refentrytitle>glShaderBinary</refentrytitle></citerefentry></para>
+ </refsect1>
+ <refsect1 id="copyright"><title>Copyright</title>
+ <para>
+ Copyright <trademark class="copyright"></trademark> 2003-2005 3Dlabs Inc. Ltd.
+ This material may be distributed subject to the terms and conditions set forth in
+ the Open Publication License, v 1.0, 8 June 1999.
+ <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
+ </para>
+ </refsect1>
+</refentry>
View
186 Source/Bind/Specifications/Docs/ES20/glBindAttribLocation.xml
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
+ "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
+<refentry id="glBindAttribLocation">
+ <refmeta>
+ <refentrytitle>glBindAttribLocation</refentrytitle>
+ <manvolnum>3G</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>glBindAttribLocation</refname>
+ <refpurpose>associate a generic vertex attribute index with a named attribute variable</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv><title>C Specification</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>void <function>glBindAttribLocation</function></funcdef>
+ <paramdef>GLuint <parameter>program</parameter></paramdef>
+ <paramdef>GLuint <parameter>index</parameter></paramdef>
+ <paramdef>const GLchar *<parameter>name</parameter></paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ </refsynopsisdiv>
+ <refsect1 id="parameters"><title>Parameters</title>
+ <variablelist>
+ <varlistentry>
+ <term><parameter>program</parameter></term>
+ <listitem>
+ <para>Specifies the handle of the program object in
+ which the association is to be made.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>index</parameter></term>
+ <listitem>
+ <para>Specifies the index of the generic vertex
+ attribute to be bound.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><parameter>name</parameter></term>
+ <listitem>
+ <para>Specifies a null terminated string containing
+ the name of the vertex shader attribute variable to
+ which <parameter>index</parameter> is to be
+ bound.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1 id="description"><title>Description</title>
+ <para><function>glBindAttribLocation</function> is used to
+ associate a user-defined attribute variable in the program
+ object specified by <parameter>program</parameter> with a
+ generic vertex attribute index. The name of the user-defined
+ attribute variable is passed as a null terminated string in
+ <parameter>name</parameter>. The generic vertex attribute index
+ to be bound to this variable is specified by
+ <parameter>index</parameter>. When
+ <parameter>program</parameter> is made part of current state,
+ values provided via the generic vertex attribute
+ <parameter>index</parameter> will modify the value of the
+ user-defined attribute variable specified by
+ <parameter>name</parameter>.</para>
+
+ <para>If <parameter>name</parameter> refers to a matrix
+ attribute variable, <parameter>index</parameter> refers to the
+ first column of the matrix. Other matrix columns are then
+ automatically bound to locations <parameter>index+1</parameter>
+ for a matrix of type mat2; <parameter>index+1</parameter> and
+ <parameter>index+2</parameter> for a matrix of type mat3; and
+ <parameter>index+1</parameter>, <parameter>index+2</parameter>,
+ and <parameter>index+3</parameter> for a matrix of type
+ mat4.</para>
+
+ <para>This command makes it possible for vertex shaders to use
+ descriptive names for attribute variables rather than generic
+ variables that are numbered from 0 to
+ <constant>GL_MAX_VERTEX_ATTRIBS</constant> -1. The values sent
+ to each generic attribute index are part of current state, just
+ like standard vertex attributes such as color, normal, and
+ vertex position. If a different program object is made current
+ by calling
+ <citerefentry><refentrytitle>glUseProgram</refentrytitle></citerefentry>,
+ the generic vertex attributes are tracked in such a way that the
+ same values will be observed by attributes in the new program
+ object that are also bound to
+ <parameter>index</parameter>.</para> <para>Attribute variable
+ name-to-generic attribute index bindings for a program object
+ can be explicitly assigned at any time by calling
+ <function>glBindAttribLocation</function>. Attribute bindings do
+ not go into effect until
+ <citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>
+ is called. After a program object has been linked successfully,
+ the index values for generic attributes remain fixed (and their
+ values can be queried) until the next link command
+ occurs.</para>
+
+ <para>Applications are not allowed to bind any of the standard