you could use ironpython for that. it's supposed to be very easy to include in a c# project.
@stromausfall: thanks for offering your help. maybe i will have some questions about delegates. i don't wrap the engine in c# but in boo. doesn't make much difference though and it will be usable by all .net languages.
in boo the wrapper will look kind of like that:
Code:
class Engine:
ev as ENGINE_VARS
def constructor(commandline as string):
ev = Marshal.PtrToStructure(engine_open(commandline), ENGINE_VARS)
def frame():
return engine_frame()
def close():
engine_close()
version as single:
get: return _FLOAT(Marshal.ReadInt32(ev.version))
edition as int:
get: return _INT(Marshal.ReadInt32(ev.edition))
compatibility as int:
get: return _INT(Marshal.ReadInt32(ev.compatibility))
set: Marshal.WriteInt32(ev.compatibility, _VAR(value))
...
edit: i tested using the boo wrapper from c# now. works nicely. i really like how all languages can work together automatically in .net. here is how it looks like:
Code:
using System;
using a7;
namespace test
{
class Program
{
public static void Main(string[] args)
{
Engine e = new Engine("-nwnd");
Console.WriteLine(e.version);
Vector v1 = new Vector(10, 10, 10);
Vector v2 = new Vector(30, 30, 30);
Vector v = v1 + v2;
Console.WriteLine(v);
while(e.frame() != 0)
{
}
e.close();
}
}
}