Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (7th_zorro, degenerate_762, AndrewAMD, ozgur), 774 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 13 of 32 1 2 11 12 13 14 15 31 32
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 Offline OP
User
Stromausfall  Offline 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.

get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread
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 Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
wow, looks complicated. why not use ironpython?
http://secretgeek.net/host_ironpython.asp
with 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 Offline
Serious User
DJBMASTER  Offline
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] #281841
07/28/09 22:03
07/28/09 22:03
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
WOW ironpython seems powerful. In under 5 mins i had everything set up and running and it worked pretty well. I'll see if i can now call something like "ent_create" from a string...

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 Offline
Serious User
DJBMASTER  Offline
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: DJBMASTER] #281873
07/29/09 06:23
07/29/09 06:23
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
That's a good idea i would say, thus all internal methods and properties wouldn't be visible from outside, just as they were meant to be. But i will do some research if DLL is at least as fast as plain source code - that's in fact what matters ^^


get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread
Re: C# wrapper - RELEASE 1.1.1.3 [Re: Stromausfall] #281898
07/29/09 10:44
07/29/09 10:44
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Well i havent tested it but i'm sure there wouldnt be any performance hit, if not the DLL runs faster. The source files all together occupy around 1.2mb, but the DLL is only around 300kb, so it probably strips down some of the common data or compresses it.

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.

Either way the wrapper works fine.

Re: C# wrapper - RELEASE 1.1.1.3 [Re: DJBMASTER] #281908
07/29/09 11:35
07/29/09 11:35
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
That debug thing makes the point i would say. And creating a dll from the wrapper shouldn't be hard if anyone wants to. Did you have to change much to get it into a dll ?


get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread
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 Offline
Senior Member
pararealist  Offline
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
&#9675;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 Offline
Serious User
DJBMASTER  Offline
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.
Page 13 of 32 1 2 11 12 13 14 15 31 32

Moderated by  TWO 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1