2 registered members (AndrewAMD, VoroneTZ),
779
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: C# wrapper - RELEASE 1.1.1.3
[Re: Stromausfall]
#281836
07/28/09 21:38
07/28/09 21:38
|
Joined: Dec 2002
Posts: 616 Austria
Stromausfall
OP
User
|
OP
User
Joined: Dec 2002
Posts: 616
Austria
|
It seems that the code overall is quite short, but this can't be the whole source to call for example engine_close() in the dll or ?
I'm missing something like this :
[DllImport("acknex.dll")] internal static extern void engine_close();
Last edited by Stromausfall; 07/28/09 21:39.
|
|
|
Re: C# wrapper - RELEASE 1.1.1.3
[Re: Stromausfall]
#281837
07/28/09 21:40
07/28/09 21:40
|
Joined: May 2002
Posts: 7,441
ventilator
Senior Expert
|
Senior Expert
Joined: May 2002
Posts: 7,441
|
wow, looks complicated. why not use ironpython? http://secretgeek.net/host_ironpython.aspwith just a few lines of code you get a full scripting engine and for one liners python doesn't look different to c# anyway. yes, in boo you also need the [DllImport("acknex.dll")]. i left it away in the example snippet.
|
|
|
Re: C# wrapper - RELEASE 1.1.1.3
[Re: ventilator]
#281839
07/28/09 21:43
07/28/09 21:43
|
Joined: Nov 2007
Posts: 1,143 United Kingdom
DJBMASTER
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,143
United Kingdom
|
hmmm, i'll look into ironpython.
Yeh the C# way looks complicated because you have to build assemblies at runtime, and i guess you have to be really comfortable with reflection; which i'm not lol.
Last edited by DJBMASTER; 07/28/09 21:44.
|
|
|
Re: C# wrapper - RELEASE 1.1.1.3
[Re: DJBMASTER]
#281851
07/28/09 23:09
07/28/09 23:09
|
Joined: Nov 2007
Posts: 1,143 United Kingdom
DJBMASTER
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,143
United Kingdom
|
hmmm, i'm not really sure how to use ironpython. I can use it to change controls at runtime, but i had no success in using it to create engine objects like an ENTITY*.
I did some browsing and learnt what assemblies and functions i needed to create assemblies at runtime and execute my own code. The only requirement is that I pass in required DLLs, so i had to compile the C# wrapper into a single DLL. The result is pretty good. I called "ent_create..." from a string and it created then entity just like as if it had been compiled on the project build.
There will be a slight lag due to memory IO but it should be OK. I dont really need this for my project right now, just thought it would be cool to learn it, but this method has the potential to create a whole new game engine allowing the user to write actions / particles / shaders and test them in real-time without the need for compilation by acknex.
BTW Stromousfall, isn't it easier to compile the Wrapper source files into one DLL and then distribute that?
Last edited by DJBMASTER; 07/28/09 23:10.
|
|
|
Re: C# wrapper - RELEASE 1.1.1.3
[Re: Stromausfall]
#281936
07/29/09 14:58
07/29/09 14:58
|
Joined: Dec 2006
Posts: 434 UK,Terra, SolarSystem, Milky W...
pararealist
Senior Member
|
Senior Member
Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
|
<<Only thing is, i'm not sure if you can debug inside a DLL. At the moment if we have a crash we can find the method/line inside the wrapper which is causing it and report it to you. I'm not sure how we would do that with a DLL.>>
This makes sense.
A8.3x Commercial, AcknexWrapper and VS 2010 Express ○pararealist now.
|
|
|
Re: C# wrapper - RELEASE 1.1.1.3
[Re: pararealist]
#282074
07/30/09 09:01
07/30/09 09:01
|
Joined: Nov 2007
Posts: 1,143 United Kingdom
DJBMASTER
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,143
United Kingdom
|
It wasn't hard creating the DLL, because they all share the common namespace "AcknexWrapper". I just created a new 'Class Library Project'. Added the AcknexWrapper folder, press build and the DLL is created.
Then to use it in the project just add a reference to it, and all functions remain the same, no problems.
But I think the fact that we can't debug is a disadvantage and so i'm leaving it as it is for the moment. Maybe when you get a rock-solid version that causes no crashes, then maybe a DLL is more suitable.
Last edited by DJBMASTER; 07/30/09 09:02.
|
|
|
|