Opentk/Source/OpenGL/Bind/Process/Process.cs

88 lines
3.1 KiB
C#
Raw Normal View History

2006-09-24 14:04:39 +00:00
/* 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> _function_collection = new List<Function>();
public List<Function> FunctionCollection
{
get { return _function_collection; }
set { _function_collection = value; }
}
#endregion
#region Wrapper collection property
List<Function> _wrapper_collection = new List<Function>();
public List<Function> WrapperCollection
{
get { return _wrapper_collection; }
set { _wrapper_collection = value; }
}
#endregion
#region Constructor
/// <summary>
/// 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.
/// </summary>
/// <param name="Properties.Bind.Default.InputPath">A string containing the path to the input file.</param>
/// <param name="Properties.Bind.Default.OutputPath">A string containing the path to the output directory.</param>
/// <param name="complete_block">Contains the full list of constants and functions generated by this processor.</param>
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
}
}