2009-02-22 10:43:35 +00:00
|
|
|
|
#region --- License ---
|
|
|
|
|
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
|
|
|
|
|
* See license.txt for license info
|
|
|
|
|
*/
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
using System.Diagnostics;
|
2009-08-21 20:28:14 +00:00
|
|
|
|
using Bind.Structures;
|
2009-02-22 10:43:35 +00:00
|
|
|
|
|
|
|
|
|
namespace Bind.Wgl
|
|
|
|
|
{
|
2009-08-21 20:28:14 +00:00
|
|
|
|
class Generator : GL2.Generator
|
2009-02-22 10:43:35 +00:00
|
|
|
|
{
|
|
|
|
|
#region --- Constructors ---
|
|
|
|
|
|
|
|
|
|
public Generator()
|
|
|
|
|
: base()
|
|
|
|
|
{
|
2009-03-08 18:08:35 +00:00
|
|
|
|
glTypemap = "Wgl/wgl.tm";
|
2009-02-22 10:43:35 +00:00
|
|
|
|
csTypemap = "csharp.tm";
|
2009-03-08 18:08:35 +00:00
|
|
|
|
enumSpec = "Wgl/wglenum.spec";
|
|
|
|
|
enumSpecExt = "Wgl/wglenumext.spec";
|
|
|
|
|
glSpec = "Wgl/wgl.spec";
|
|
|
|
|
glSpecExt = "Wgl/wglext.spec";
|
2009-02-22 10:43:35 +00:00
|
|
|
|
|
|
|
|
|
importsFile = "WglCore.cs";
|
|
|
|
|
delegatesFile = "WglDelegates.cs";
|
|
|
|
|
enumsFile = "WglEnums.cs";
|
|
|
|
|
wrappersFile = "Wgl.cs";
|
|
|
|
|
|
|
|
|
|
Settings.OutputClass = "Wgl";
|
|
|
|
|
Settings.FunctionPrefix = "wgl";
|
|
|
|
|
Settings.ConstantPrefix = "WGL_";
|
|
|
|
|
|
|
|
|
|
if (Settings.Compatibility == Settings.Legacy.Tao)
|
|
|
|
|
{
|
|
|
|
|
Settings.OutputNamespace = "Tao.Platform.Windows";
|
|
|
|
|
Settings.WindowsGDI = "Tao.Platform.Windows.Gdi";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Settings.OutputNamespace = "OpenTK.Platform.Windows";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
public override void Process()
|
|
|
|
|
{
|
2009-08-21 20:28:14 +00:00
|
|
|
|
Type.Initialize(glTypemap, csTypemap);
|
|
|
|
|
Enum.Initialize(enumSpec, enumSpecExt);
|
|
|
|
|
Function.Initialize();
|
|
|
|
|
Delegate.Initialize(glSpec, glSpecExt);
|
2009-02-22 10:43:35 +00:00
|
|
|
|
|
|
|
|
|
// Process enums and delegates - create wrappers.
|
|
|
|
|
Trace.WriteLine("Processing specs, please wait...");
|
|
|
|
|
//this.Translate();
|
|
|
|
|
|
|
|
|
|
this.WriteBindings(
|
2009-08-21 20:28:14 +00:00
|
|
|
|
Delegate.Delegates,
|
|
|
|
|
Function.Wrappers,
|
|
|
|
|
Enum.GLEnums);
|
2009-02-22 10:43:35 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|