/* Copyright (c) 2006 Stephen Apostolopoulos * See license.txt for license info */ using System; using System.Collections.Generic; using System.Text; using System.IO; using System.Threading; namespace OpenTK.OpenGL.Bind { partial class Process { #region Enum collection property System.Collections.Hashtable _enum_collection = new System.Collections.Hashtable(); public System.Collections.Hashtable EnumCollection { get { return _enum_collection; } set { _enum_collection = value; } } #endregion #region Function collection property List _function_collection = new List(); public List FunctionCollection { get { return _function_collection; } set { _function_collection = value; } } #endregion #region Wrapper collection property List _wrapper_collection = new List(); public List WrapperCollection { get { return _wrapper_collection; } set { _wrapper_collection = value; } } #endregion #region Constructor /// /// Processes the file given in the input_file parameter and writes the output /// to the path sepcified by the Properties.Bind.Default.OutputPath parameter. The Block parameter /// contains the complete list of bindings for this class. /// /// A string containing the path to the input file. /// A string containing the path to the output directory. /// Contains the full list of constants and functions generated by this processor. public Process() { long ticks = System.DateTime.Now.Ticks; ReadSpecs("gl.spec"); ReadSpecs("enum.spec"); ReadSpecs("enumext.spec"); Translation.Translate(FunctionCollection, WrapperCollection); Translation.Translate(EnumCollection); WriteFunctions(Properties.Bind.Default.OutputPath); WriteEnums(Properties.Bind.Default.OutputPath); WriteWrappers(Properties.Bind.Default.OutputPath); WritePerContextLoad(Properties.Bind.Default.OutputPath, "WindowsContext", "1.0", "1.1"); WritePerContextLoad(Properties.Bind.Default.OutputPath, "WindowsVistaContext", "1.0", "1.1", "1.2", "1.3", "1.4"); WritePerContextLoad(Properties.Bind.Default.OutputPath, "X11Context", "1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "2.0"); ticks = System.DateTime.Now.Ticks - ticks; Console.WriteLine("Bindings generated in {0} seconds.", ticks / (double)10000000.0); Thread.Sleep(1000); // In order to allow new files to be copied to be parsed by the OpenTK build target. } #endregion } }