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); } } }
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)); }
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(); }
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); } } }
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); } }