Beispiel #1
0
        private void ApplyGlVersion(GlVersion glVersion)
        {
            foreach (GlEnum glEnum in glVersion.AddedEnums)
            {
                if (!Enums.Contains(glEnum))
                {
                    Enums.Add(glEnum);
                }
            }
            foreach (GlFunction glFunction in glVersion.AddedFunctions)
            {
                if (!Functions.Contains(glFunction))
                {
                    Functions.Add(glFunction);
                }
            }

            if (HasProfiles)
            {
                if (Profile == GlProfile.Core)
                {
                    ApplyCoreProfile(glVersion);
                }
                else if (Profile == GlProfile.Compatibility)
                {
                    ApplyCompatibilityProfile(glVersion);
                }
            }
        }
Beispiel #2
0
        private void ApplyCoreProfile(GlVersion glVersion)
        {
            foreach (GlEnum glEnum in glVersion.AddedCoreEnums)
            {
                if (!Enums.Contains(glEnum))
                {
                    Enums.Add(glEnum);
                }
            }

            Enums.RemoveAll(glEnum => glVersion.RemovedCoreEnums.Contains(glEnum));
            Functions.RemoveAll(glFunction => glVersion.RemovedCoreFunctions.Contains(glFunction));
        }
Beispiel #3
0
        static void Run(CmdOptions options)
        {
            GlParser.Parse(GetGlXmlStream());

            GlVersion glVersion = GlParser.GetGlVersion(options);

            if (glVersion == null)
            {
                Console.WriteLine("Can't find specified gl version or profile.");
                return;
            }

            new GlFullVersion(glVersion, options.Profile).Generate();
        }
Beispiel #4
0
 private void ApplyCompatibilityProfile(GlVersion glVersion)
 {
     foreach (GlEnum glEnum in glVersion.AddedCompatibilityEnums)
     {
         if (!Enums.Contains(glEnum))
         {
             Enums.Add(glEnum);
         }
     }
     foreach (GlFunction glFunction in glVersion.AddedCompatibilityFunctions)
     {
         if (!Functions.Contains(glFunction))
         {
             Functions.Add(glFunction);
         }
     }
 }
Beispiel #5
0
        public GlFullVersion(GlVersion glTargetVersion, GlProfile profile)
        {
            Version       = glTargetVersion.Version;
            VersionDouble = glTargetVersion.VersionDouble;
            Profile       = profile;

            Enums     = new List <GlEnum>();
            Functions = new List <GlFunction>();

            foreach (GlVersion glVersion in GlParser.Versions)
            {
                if (glVersion.VersionDouble > glTargetVersion.VersionDouble)
                {
                    break;
                }

                ApplyGlVersion(glVersion);
            }
        }