Hi,
I have a scenario where AngelScript is used in a DLL library (AngelScript itself is built and linked to as a static library) and I would like to register certain object methods in the application using my DLL with AngelScript. I would, however, not want to expose the application to the AngelScript API but rather expose a very simple API through my DLL, to prevent the app from having to link against AngelScript directly. The way I would want to register the methods is through fastdelegates (as that is what I am using for most other things).
I was wondering if someone has managed to register a fastdelegate directly with AngelScript. For example, can I somehow pass a fastdelegate to RegisterObjectMethod() instead of having to use the normal asMETHOD macros?
If that cannot be easily done, is there a way to register the same C++ method with two different AngelScript methods, and then somehow be able to figure out (on the C++ side) which AngelScript method was called.
Eg.
Can I register "void foo(int i)" and "void foo2(int i)" in AngelScript with "void foo(int i, int ID)" on the C++ side and then have the ID parameter automatically filled in with 0 when foo() is called and 1 when foo2() is called (or some other way to determine which method was called in AS)? If this was possible I could then forward the call to the correct fastdelegate myself.
Cheers!