mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-02-24 23:26:55 +00:00
Added Glu and Glx generators to Bind.
This commit is contained in:
parent
728a5c9ec6
commit
fc4e0f3698
|
@ -1,10 +1,62 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace Bind.Glu
|
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;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace Bind.Glx
|
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
|
enum GeneratorMode
|
||||||
{
|
{
|
||||||
|
Unknown,
|
||||||
GL2,
|
GL2,
|
||||||
GL3,
|
GL3,
|
||||||
Wgl,
|
Wgl,
|
||||||
Glx,
|
Glx,
|
||||||
Glu
|
Glu,
|
||||||
}
|
}
|
||||||
|
|
||||||
static class MainClass
|
static class MainClass
|
||||||
|
@ -73,8 +74,12 @@ namespace Bind
|
||||||
arg == "gl2" ? GeneratorMode.GL2 :
|
arg == "gl2" ? GeneratorMode.GL2 :
|
||||||
arg == "gl3" ? GeneratorMode.GL3 :
|
arg == "gl3" ? GeneratorMode.GL3 :
|
||||||
arg == "wgl" ? GeneratorMode.Wgl :
|
arg == "wgl" ? GeneratorMode.Wgl :
|
||||||
arg == "glu" ? GeneratorMode.Glu :
|
arg == "glu" ? GeneratorMode.Glu :
|
||||||
arg == "glx" ? GeneratorMode.Glx : GeneratorMode.GL2;
|
arg == "glx" ? GeneratorMode.Glx : GeneratorMode.Unknown;
|
||||||
|
if (mode == GeneratorMode.Unknown)
|
||||||
|
{
|
||||||
|
throw new ArgumentException(String.Format("Mode {0} unknown.", arg));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "namespace":
|
case "namespace":
|
||||||
case "ns":
|
case "ns":
|
||||||
|
@ -126,11 +131,11 @@ namespace Bind
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GeneratorMode.Glu:
|
case GeneratorMode.Glu:
|
||||||
|
Generator = new Bind.Glu.Generator();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GeneratorMode.Glx:
|
case GeneratorMode.Glx:
|
||||||
|
Generator = new Bind.Glx.Generator();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GeneratorMode.GL3:
|
case GeneratorMode.GL3:
|
||||||
|
|
Loading…
Reference in a new issue