mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-25 01:55:34 +00:00
Added GL4Generator that utilizes xml files instead of spec files.
Made GL4Generator the default. Added FuncProcessor that will contain all function transforms.
This commit is contained in:
parent
bdbd50dd08
commit
4e8c643c39
49
Source/Bind/FuncProcessor.cs
Normal file
49
Source/Bind/FuncProcessor.cs
Normal file
|
@ -0,0 +1,49 @@
|
|||
#region License
|
||||
//
|
||||
// The Open Toolkit Library License
|
||||
//
|
||||
// Copyright (c) 2006 - 2010 the Open Toolkit library.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights to
|
||||
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
// the Software, and to permit persons to whom the Software is furnished to do
|
||||
// so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
// OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Xml.XPath;
|
||||
|
||||
namespace Bind
|
||||
{
|
||||
class FuncProcessor
|
||||
{
|
||||
const string Path = "/overrides/replace/function[@name='{0}']";
|
||||
XPathDocument Overrides { get; set; }
|
||||
|
||||
public FuncProcessor(XPathDocument overrides)
|
||||
{
|
||||
if (overrides == null)
|
||||
throw new ArgumentNullException("overrides");
|
||||
|
||||
Overrides = overrides;
|
||||
}
|
||||
}
|
||||
}
|
34
Source/Bind/GL2/GL4Generator.cs
Normal file
34
Source/Bind/GL2/GL4Generator.cs
Normal file
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Bind.GL2
|
||||
{
|
||||
class GL4Generator : ES.ESGenerator
|
||||
{
|
||||
public GL4Generator(string name, string dirname)
|
||||
: base(name, dirname)
|
||||
{
|
||||
glTypemap = "GL2/gl.tm";
|
||||
csTypemap = "csharp.tm";
|
||||
|
||||
enumSpec = "GL2/signatures.xml";
|
||||
enumSpecExt = String.Empty;
|
||||
glSpec = "GL2/signatures.xml";
|
||||
glSpecExt = String.Empty;
|
||||
functionOverridesFile = "GL2/gloverrides.xml";
|
||||
|
||||
importsFile = "GLCore.cs";
|
||||
delegatesFile = "GLDelegates.cs";
|
||||
enumsFile = "GLEnums.cs";
|
||||
wrappersFile = "GL.cs";
|
||||
Settings.ImportsClass = "Core";
|
||||
Settings.DelegatesClass = "Delegates";
|
||||
|
||||
Settings.OutputClass = "GL";
|
||||
Settings.OutputNamespace = "OpenTK.Graphics.OpenGL";
|
||||
Settings.OutputPath = "../../../Source/OpenTK/Graphics/OpenGL";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -139,6 +139,7 @@
|
|||
<Compile Include="..\GlobalAssemblyInfo.cs">
|
||||
<Link>Properties\GlobalAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="FuncProcessor.cs" />
|
||||
<Compile Include="GL2\GL4Generator.cs" />
|
||||
<Compile Include="IBind.cs">
|
||||
<SubType>Code</SubType>
|
||||
|
@ -155,6 +156,7 @@
|
|||
<Compile Include="BindStreamWriter.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="EnumProcessor.cs" />
|
||||
<Compile Include="Utilities.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
|
@ -944,6 +946,11 @@
|
|||
<None Include="Specifications\License.txt">
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Specifications\GL2\signatures.xml">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
|
|
|
@ -138,7 +138,7 @@ namespace Bind
|
|||
switch (mode)
|
||||
{
|
||||
case GeneratorMode.GL2:
|
||||
Generator = new Generator();
|
||||
Generator = new GL4Generator("OpenGL", dirName);
|
||||
break;
|
||||
|
||||
case GeneratorMode.ES10:
|
||||
|
|
Loading…
Reference in a new issue