EgorBo 4c9df3372a fix structs' layouts (thanks to asserts_32/64.h) 8 năm trước cách đây
..
AssetsModelGenerator 95102ab1f2 Add ShaderParameters to CoreAssets 8 năm trước cách đây
Properties e5d9d91165 Add binder 10 năm trước cách đây
StructsValidator 4c9df3372a fix structs' layouts (thanks to asserts_32/64.h) 8 năm trước cách đây
bin de80317aaf add Clang.dll, libclang-mono.dylib and Sharpie.Bind.dll to the repo 10 năm trước cách đây
.gitignore ce8253e11b Fix SharpieBinder paths 10 năm trước cách đây
Commenter.cs d563651ac9 Surface GPUObject. Close #176 9 năm trước cách đây
CxxBinder.cs 4eedcdd824 update bindings 8 năm trước cách đây
LICENSE 7d8915c901 Update license 10 năm trước cách đây
NamespaceRegistry.cs f5a6b77da1 Small CxxBinder refactoring\cleanup. 9 năm trước cách đây
OptionalParametersParser.cs 58a8b9cc44 Add optional parameters everywhere (SharpieBinder) 8 năm trước cách đây
Program.cs 2d9428ecd6 Apply Bait and Switch approach. 10 năm trước cách đây
README.md e8b51b6044 More work 10 năm trước cách đây
ScanBaseTypes.cs 0bb1bcd836 add more setters (keep SetX methods public) 8 năm trước cách đây
SharpieBinder.csproj 58a8b9cc44 Add optional parameters everywhere (SharpieBinder) 8 năm trước cách đây
SharpieBinder.sln df69c68903 [Bindings] add MemoryBuffer support 9 năm trước cách đây
StringUtil.cs 58a8b9cc44 Add optional parameters everywhere (SharpieBinder) 8 năm trước cách đây
nuget.config 01652254b1 Fixed SharpieBinder nuget path 10 năm trước cách đây
packages.config 408b818210 Undo CustomMarshaller & custom NRefactory libs 10 năm trước cách đây

README.md

Requirements

  • ObjectiveSharpie built and installed
  • 64-bit Mono
  • libclang-mono.dylib installed in /usr/lib (from ObjectiveSharpie)
  • PCH file generated from parsing all Urho3D header files

When executed, currently dumps the C# bindigns in /tmp/ra

Design Binding Notes

The API in Urho3D is luckily not designed to be used as an object oriented toolbox, so it is rare the case where users must subclass. This has the advantage for a binding that there is no need to support the scenario where subclasses in C# must be able to override methods in the system.

Consideration: should we allow subclassing of the Urho classes? If we do, then we need to have a "Runtime.GetObejct"-like system to ensure that given an unmanaged pointer, we always return the same instance to managed code.

If not, we could just make all wrappers be dumb wrappers and override the Equals, operator == and operator != methods.

Overview of SharpieBinder

The Urho binder in this directory works by using the precompiled header file for all of Urho's API and producing C# bindings that P/Invoke into a glue library written in C, which in turn calls into the C++ API.

This uses the ObjectieSharpie binding to Clang which surfaces the information, and the Sharpie's binder library, which provides a mechanism to walk the AST.

The program creates two AST walkers, one that does a first pass to collect information like core types and pairs of getters and setters, and a second step that redoes the work and produces an NRefactory set of AST nodes that eventually generate C# sources and some manual print commands to generate the C binding.