mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-11 02:25:29 +00:00
Added Glu and Glx generators to Bind.
This commit is contained in:
parent
e1b0d5fdb5
commit
3104a880a1
|
@ -1,10 +1,62 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
|
||||
namespace Bind.Glu
|
||||
{
|
||||
class Generator
|
||||
class Generator : Bind.GL2.Generator
|
||||
{
|
||||
#region --- Constructors ---
|
||||
|
||||
public Generator()
|
||||
: base()
|
||||
{
|
||||
glTypemap = "Glu\\glu.tm";
|
||||
csTypemap = "csharp.tm";
|
||||
enumSpec = "Glu\\enumglu.spec";
|
||||
enumSpecExt = "";
|
||||
glSpec = "Glu\\glu.spec";
|
||||
glSpecExt = "";
|
||||
|
||||
importsFile = "GluCore.cs";
|
||||
delegatesFile = "GluDelegates.cs";
|
||||
enumsFile = "GluEnums.cs";
|
||||
wrappersFile = "Glu.cs";
|
||||
|
||||
Settings.OutputClass = "Glu";
|
||||
Settings.FunctionPrefix = "glu";
|
||||
Settings.ConstantPrefix = "GLU_";
|
||||
|
||||
if (Settings.Compatibility == Settings.Legacy.Tao)
|
||||
{
|
||||
Settings.OutputNamespace = "Tao.OpenGl";
|
||||
//Settings.WindowsGDI = "Tao.Platform.Windows.Gdi";
|
||||
}
|
||||
else
|
||||
{
|
||||
Settings.OutputNamespace = "OpenTK.OpenGL";
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public override void Process()
|
||||
{
|
||||
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...");
|
||||
this.Translate();
|
||||
|
||||
this.WriteBindings(
|
||||
Bind.Structures.Delegate.Delegates,
|
||||
Bind.Structures.Function.Wrappers,
|
||||
Bind.Structures.Enum.GLEnums);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,62 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Bind.Glx
|
||||
{
|
||||
class Generator
|
||||
class Generator : Bind.GL2.Generator
|
||||
{
|
||||
#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()
|
||||
{
|
||||
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...");
|
||||
this.Translate();
|
||||
|
||||
this.WriteBindings(
|
||||
Bind.Structures.Delegate.Delegates,
|
||||
Bind.Structures.Function.Wrappers,
|
||||
Bind.Structures.Enum.GLEnums);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,11 +18,12 @@ namespace Bind
|
|||
{
|
||||
enum GeneratorMode
|
||||
{
|
||||
Unknown,
|
||||
GL2,
|
||||
GL3,
|
||||
Wgl,
|
||||
Glx,
|
||||
Glu
|
||||
Glu,
|
||||
}
|
||||
|
||||
static class MainClass
|
||||
|
@ -73,8 +74,12 @@ namespace Bind
|
|||
arg == "gl2" ? GeneratorMode.GL2 :
|
||||
arg == "gl3" ? GeneratorMode.GL3 :
|
||||
arg == "wgl" ? GeneratorMode.Wgl :
|
||||
arg == "glu" ? GeneratorMode.Glu :
|
||||
arg == "glx" ? GeneratorMode.Glx : GeneratorMode.GL2;
|
||||
arg == "glu" ? GeneratorMode.Glu :
|
||||
arg == "glx" ? GeneratorMode.Glx : GeneratorMode.Unknown;
|
||||
if (mode == GeneratorMode.Unknown)
|
||||
{
|
||||
throw new ArgumentException(String.Format("Mode {0} unknown.", arg));
|
||||
}
|
||||
break;
|
||||
case "namespace":
|
||||
case "ns":
|
||||
|
@ -126,11 +131,11 @@ namespace Bind
|
|||
break;
|
||||
|
||||
case GeneratorMode.Glu:
|
||||
|
||||
Generator = new Bind.Glu.Generator();
|
||||
break;
|
||||
|
||||
case GeneratorMode.Glx:
|
||||
|
||||
Generator = new Bind.Glx.Generator();
|
||||
break;
|
||||
|
||||
case GeneratorMode.GL3:
|
||||
|
|
Loading…
Reference in a new issue