2007-08-10 09:27:13 +00:00
|
|
|
|
#region --- License ---
|
|
|
|
|
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
|
|
|
|
|
* See license.txt for license info
|
|
|
|
|
*/
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
using System;
|
2007-08-04 23:46:06 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
2007-08-12 16:14:23 +00:00
|
|
|
|
using System.Diagnostics;
|
2007-09-02 00:40:43 +00:00
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
using Bind.Structures;
|
2007-08-04 23:46:06 +00:00
|
|
|
|
|
|
|
|
|
namespace Bind.Wgl
|
|
|
|
|
{
|
|
|
|
|
class Generator : Bind.GL2.Generator
|
|
|
|
|
{
|
2007-08-20 10:46:37 +00:00
|
|
|
|
#region --- Constructors ---
|
|
|
|
|
|
2007-08-20 12:25:48 +00:00
|
|
|
|
public Generator()
|
|
|
|
|
: base()
|
2007-08-04 23:46:06 +00:00
|
|
|
|
{
|
2007-08-12 16:14:23 +00:00
|
|
|
|
glTypemap = "Wgl\\wgl.tm";
|
|
|
|
|
csTypemap = "csharp.tm";
|
|
|
|
|
enumSpec = "Wgl\\wglenum.spec";
|
|
|
|
|
enumSpecExt = "Wgl\\wglenumext.spec";
|
|
|
|
|
glSpec = "Wgl\\wgl.spec";
|
|
|
|
|
glSpecExt = "Wgl\\wglext.spec";
|
|
|
|
|
|
|
|
|
|
importsFile = "WglCore.cs";
|
|
|
|
|
delegatesFile = "WglDelegates.cs";
|
|
|
|
|
enumsFile = "WglEnums.cs";
|
|
|
|
|
wrappersFile = "Wgl.cs";
|
2007-08-20 10:46:37 +00:00
|
|
|
|
|
2007-08-20 12:25:48 +00:00
|
|
|
|
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";
|
|
|
|
|
}
|
2007-08-04 23:46:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2007-08-20 10:46:37 +00:00
|
|
|
|
#endregion
|
|
|
|
|
|
2007-08-04 23:46:06 +00:00
|
|
|
|
public override void Process()
|
|
|
|
|
{
|
2007-08-12 16:14:23 +00:00
|
|
|
|
Bind.Structures.Type.Initialize(glTypemap, csTypemap);
|
|
|
|
|
Bind.Structures.Enum.Initialize(enumSpec, enumSpecExt);
|
|
|
|
|
Bind.Structures.Function.Initialize();
|
|
|
|
|
Bind.Structures.Delegate.Initialize(glSpec, glSpecExt);
|
|
|
|
|
|
|
|
|
|
// Process enums and delegates - create wrappers.
|
|
|
|
|
Trace.WriteLine("Processing specs, please wait...");
|
2007-11-10 10:26:04 +00:00
|
|
|
|
//this.Translate();
|
2007-08-12 16:14:23 +00:00
|
|
|
|
|
|
|
|
|
this.WriteBindings(
|
|
|
|
|
Bind.Structures.Delegate.Delegates,
|
|
|
|
|
Bind.Structures.Function.Wrappers,
|
|
|
|
|
Bind.Structures.Enum.GLEnums);
|
2007-08-04 23:46:06 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|