/// <summary>
        /// Gets the documentation for a baked profile - a raw profile should not be used.
        /// </summary>
        /// <param name="profile">The baked profile.</param>
        /// <param name="docsDotGl">The root of a docs.gl clone.</param>
        /// <returns>The documentation for this baked profile.</returns>
        public static ProfileDocumentation GetDocumentation(Profile profile, string docsDotGl)
        {
            if (profile.Name.StartsWith("OpenGL"))
            {
                var doc = new Dictionary<int, ProfileDocumentation>
                {
                    {2, DocumentationReader.ReadProfileDocumentation(Path.Combine(docsDotGl, "gl2"), "gl")},
                    {3, DocumentationReader.ReadProfileDocumentation(Path.Combine(docsDotGl, "gl3"), "gl")},
                    {4, DocumentationReader.ReadProfileDocumentation(Path.Combine(docsDotGl, "gl4"), "gl")}
                };
                return GetOnlyNewest(doc);
            }

            switch (profile.Name)
            {
                case "GLES":
                {
                    var doc = new Dictionary<int, ProfileDocumentation>
                    {
                        {1, DocumentationReader.ReadProfileDocumentation(Path.Combine(docsDotGl, "es1"), "gl")},
                        {2, DocumentationReader.ReadProfileDocumentation(Path.Combine(docsDotGl, "es2"), "gl")},
                        {3, DocumentationReader.ReadProfileDocumentation(Path.Combine(docsDotGl, "es3"), "gl")}
                    };
                    return GetOnlyNewest(doc);
                }
                case "GLSC":
                    return DocumentationReader.ReadProfileDocumentation(Path.Combine(docsDotGl, "es2"), "gl");
                default:
                    // no documentation entry found, return dummy documentation
                    return new ProfileDocumentation {Functions = new Dictionary<string, FunctionDocumentation>()};
            }
        }
Example #2
0
        /// <summary>
        /// Gets the documentation for a baked profile - a raw profile should not be used.
        /// </summary>
        /// <param name="profile">The baked profile.</param>
        /// <param name="docsDotGl">The root of a docs.gl clone.</param>
        /// <returns>The documentation for this baked profile.</returns>
        public static ProfileDocumentation GetDocumentation(Profile profile, string docsDotGl)
        {
            if (profile.Name.StartsWith("OpenGL"))
            {
                var doc = new Dictionary <int, ProfileDocumentation>
                {
                    { 2, DocumentationReader.ReadProfileDocumentation(Path.Combine(docsDotGl, "gl2"), "gl") },
                    { 3, DocumentationReader.ReadProfileDocumentation(Path.Combine(docsDotGl, "gl3"), "gl") },
                    { 4, DocumentationReader.ReadProfileDocumentation(Path.Combine(docsDotGl, "gl4"), "gl") }
                };
                return(GetOnlyNewest(doc));
            }

            if (profile.Name == "GLES")
            {
                var doc = new Dictionary <int, ProfileDocumentation>
                {
                    { 1, DocumentationReader.ReadProfileDocumentation(Path.Combine(docsDotGl, "es1"), "gl") },
                    { 2, DocumentationReader.ReadProfileDocumentation(Path.Combine(docsDotGl, "es2"), "gl") },
                    { 3, DocumentationReader.ReadProfileDocumentation(Path.Combine(docsDotGl, "es3"), "gl") }
                };
                return(GetOnlyNewest(doc));
            }

            if (profile.Name == "GLSC")
            {
                return(DocumentationReader.ReadProfileDocumentation(Path.Combine(docsDotGl, "es2"), "gl"));
            }

            // no documentation entry found, return dummy documentation
            return(new ProfileDocumentation {
                Functions = new Dictionary <string, FunctionDocumentation>()
            });
        }