[Mono-list] Scripting Vegastrike with glue in Mono C#
Daniel Horn
danielhorn@mindspring.com
Mon, 24 Jun 2002 23:05:55 -0700
Hello I'm the lead developer of the open Source space flight sim Vegastrike
(http://vegastrike.sourceforge.net)
currently we have an inferior (as in slow, hard to add to, etc), hand-written
scripting language we call C-flat. It's somewhat object oriented, but it is
extremely slow and difficult tog et things to work, and the performance is
about 1/20 that of standard C debug code.
Being a game performance and ease of use are two extremely important facets
of choosing a scripting language.
So I searched the internet and found Boost as a method to export C++ classes
to python....
but people are recommending C# to me.... though I have searched at least 2
hours on the net to find no mention of how exactly to call C# functions from
C++ and call C++ functions (and classes) from C#....
I looked at gtk-sharp and it seems like they have some autogenerated XML to
define the glue layer or something.....
could anyone point to a simple howto telling how someone coudl do the
following
happy.cs
...
int mycsharpfunction () {
return my_c_function();
}
...
main.c
int my_c_function () {
return 4364;
}
int main () {
printf ("%d",mycsharpfunction());
}
or better
mycsharpclass.cs
class mycsharpclass {
int something;
public mycsharpclass (myclass &c) {
something = c.dosomething;
}
}
myclass.c
class myclass {
int dosomething () {return 1;}
}
int main () {
myclass c;
mycsharpclass d = new mycsharpclass (c);
}
are both of these ideas (i.e. lame pseudocode) possible in C#? is there a
simple howto about how I could do either or both of these things? or a
program that will generate XML interfaces for this stuff...I only see 2
binaries advertised...but there must be something more...somethign deeper :-)
anyhow thank you all for your time...I'm sure I'm not the only one with this
question, but there is so much hype and noise about C# that any reasonable
search string has been giving me static in google
--
- Daniel Horn (hellcatv@hotmail.com)
Vegastrike Lead Developer ( http://vegastrike.sourceforge.net )