2009-02-22 11:43:35 +01:00
|
|
|
|
#region --- License ---
|
|
|
|
|
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
|
|
|
|
|
* See license.txt for license info
|
|
|
|
|
*/
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
using System.Diagnostics;
|
2009-08-21 22:28:14 +02:00
|
|
|
|
using Bind.Structures;
|
2009-02-22 11:43:35 +01:00
|
|
|
|
|
|
|
|
|
namespace Bind.Glx
|
|
|
|
|
{
|
2009-08-21 22:28:14 +02:00
|
|
|
|
class Generator : GL2.Generator
|
2009-02-22 11:43:35 +01:00
|
|
|
|
{
|
|
|
|
|
#region --- Constructors ---
|
|
|
|
|
|
|
|
|
|
public Generator()
|
|
|
|
|
: base()
|
|
|
|
|
{
|
|
|
|
|
glTypemap = "Glx\\glx.tm";
|
|
|
|
|
csTypemap = "csharp.tm";
|
|
|
|
|
enumSpec = "Glx\\glxenum.spec";
|
|
|
|
|
enumSpecExt = "Glx\\glxenumext.spec";
|
|
|
|
|
glSpec = "Glx\\glx.spec";
|
|
|
|
|
glSpecExt = "Glx\\glxext.spec";
|
|
|
|
|
|
|
|
|
|
importsFile = "GlxCore.cs";
|
|
|
|
|
delegatesFile = "GlxDelegates.cs";
|
|
|
|
|
enumsFile = "GlxEnums.cs";
|
|
|
|
|
wrappersFile = "Glx.cs";
|
|
|
|
|
|
|
|
|
|
Settings.OutputClass = "Glx";
|
|
|
|
|
Settings.FunctionPrefix = "glX";
|
|
|
|
|
Settings.ConstantPrefix = "GLX_";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Settings.Compatibility == Settings.Legacy.Tao)
|
|
|
|
|
{
|
|
|
|
|
Settings.OutputNamespace = "Tao.Platform.Glx";
|
|
|
|
|
//Settings.WindowsGDI = "Tao.Platform.Windows.Gdi";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Settings.OutputNamespace = "OpenTK.Platform.X11";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
public override void Process()
|
|
|
|
|
{
|
2009-08-21 22:28:14 +02:00
|
|
|
|
Type.Initialize(glTypemap, csTypemap);
|
|
|
|
|
Enum.Initialize(enumSpec, enumSpecExt);
|
|
|
|
|
Function.Initialize();
|
|
|
|
|
Delegate.Initialize(glSpec, glSpecExt);
|
2009-02-22 11:43:35 +01:00
|
|
|
|
|
|
|
|
|
// Process enums and delegates - create wrappers.
|
|
|
|
|
Trace.WriteLine("Processing specs, please wait...");
|
|
|
|
|
//this.Translate();
|
|
|
|
|
|
2009-08-25 17:59:57 +02:00
|
|
|
|
WriteBindings(
|
2009-08-21 22:28:14 +02:00
|
|
|
|
Delegate.Delegates,
|
|
|
|
|
Function.Wrappers,
|
|
|
|
|
Enum.GLEnums);
|
2009-02-22 11:43:35 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|