/// <summary> /// Construct a RegistryContext. /// </summary> /// <param name="class"> /// A <see cref="String"/> that specifies the actual specification to build. It determines: /// - The name of the class to be generated (i.e. Gl, Wgl, Glx); /// - The features selection to include in the generated sources /// </param> /// <param name="registryPath"> /// A <see cref="String"/> that specifies the path of the OpenGL specification to parse. /// </param> public RegistryContext(string @class, string registryPath) { // Store the class Class = @class; // Set supported APIs List <string> apis = new List <string>(); apis.Add(Class.ToLower()); if (Class == "Gl") { // No need to add glcore, since gl is still a superset of glcore // apis.Add("glcore"); // Support GS ES 1/2 apis.Add("gles1"); apis.Add("gles2"); } SupportedApi = apis.ToArray(); // Loads the extension dictionary ExtensionsDictionary = SpecWordsDictionary.Load("BindingsGen.GLSpecs.ExtWords.xml"); // Loads the words dictionary WordsDictionary = SpecWordsDictionary.Load(String.Format("BindingsGen.GLSpecs.{0}Words.xml", @class)); // Load and parse OpenGL specification using (StreamReader sr = new StreamReader(registryPath)) { Registry = ((Registry)SpecSerializer.Deserialize(sr)); Registry.Link(this); } }
/// <summary> /// Construct a RegistryContext. /// </summary> /// <param name="class"> /// A <see cref="String"/> that specifies the actual specification to build. It determines: /// - The name of the class to be generated (i.e. Gl, Wgl, Glx); /// - The features selection to include in the generated sources /// </param> private RegistryContext(string @class, string wordsClass) { // Store the class Class = @class; // Set supported APIs List <string> apis = new List <string>(); apis.Add(Class.ToLower()); if (Class == "Gl") { // No need to add glcore, since gl is still a superset of glcore // apis.Add("glcore"); // Support GS ES 1/2 apis.Add("gles1"); apis.Add("gles2"); apis.Add("glsc2"); } SupportedApi = apis.ToArray(); // Loads the extension dictionary ExtensionsDictionary = SpecWordsDictionary.Load("BindingsGen.GLSpecs.ExtWords.xml"); // Loads the words dictionary WordsDictionary = SpecWordsDictionary.Load(String.Format("BindingsGen.GLSpecs.{0}Words.xml", wordsClass ?? @class)); }
/// <summary> /// Construct a RegistryContext. /// </summary> /// <param name="class"> /// A <see cref="String"/> that specifies the actual specification to build. It determines: /// - The name of the class to be generated (i.e. Gl, Wgl, Glx); /// - The features selection to include in the generated sources /// </param> /// <param name="registryPath"> /// A <see cref="String"/> that specifies the path of the OpenGL specification to parse. /// </param> public RegistryContext(string @class, string registryPath) { // Store the class Class = @class; // Loads the extension dictionary ExtensionsDictionary = SpecWordsDictionary.Load("BindingsGen.GLSpecs.ExtWords.xml"); // Loads the words dictionary WordsDictionary = SpecWordsDictionary.Load(String.Format("BindingsGen.GLSpecs.{0}Words.xml", @class)); // Load and parse OpenGL specification using (StreamReader sr = new StreamReader(registryPath)) { Registry = ((Registry)SpecSerializer.Deserialize(sr)); Registry.Link(this); } }