2
0
mirror of https://github.com/raylib-cs/raylib-cs synced 2025-09-09 03:01:41 -04:00

Testing the idea of generating the bindings

- Added cppsharp to see if it will work with raylib.
This commit is contained in:
2018-07-23 20:27:07 +01:00
parent 172e0ecbb7
commit d20a719c92
8 changed files with 9826 additions and 102 deletions

46
Raylib-cs/Generator.cs Normal file
View File

@@ -0,0 +1,46 @@
using CppSharp;
using CppSharp.AST;
using CppSharp.Generators;
namespace Raylibcs
{
/// <summary>
/// Generates the bindings for raylib
/// ConsoleDriver.Run(new SampleLibrary());
/// </summary>
public class SampleLibrary : ILibrary
{
public void Preprocess(Driver driver, ASTContext ctx)
{
// ctx.SetNameOfEnumWithMatchingItem("KEY_", "Keys");
// throw new NotImplementedException();
}
public void Postprocess(Driver driver, ASTContext ctx)
{
//throw new NotImplementedException();
}
void ILibrary.Setup(Driver driver)
{
var options = driver.Options;
options.GeneratorKind = GeneratorKind.CSharp;
options.Verbose = true;
var module = options.AddModule("raylib");
module.IncludeDirs.Add("C:\\raylib\\raylib\\src");
module.Headers.Add("raylib.h");
module.Headers.Add("raymath.h");
module.LibraryDirs.Add("C:\\raylib\\raylib\\release\\libs\\win32\\msvc");
module.Libraries.Add("raylib.lib");
module.Defines.Add("KEY_SPACE");
}
void ILibrary.SetupPasses(Driver driver)
{
// throw new NotImplementedException();
}
}
}