Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (ozgur, TipmyPip), 722 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 12 of 32 1 2 10 11 12 13 14 31 32
Re: C# wrapper - RELEASE 1.1.1.2 [Re: Stromausfall] #281805
07/28/09 19:44
07/28/09 19:44
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...
Hi Stromausfall

after update to ver 1.1.1.1 or ver 1.1.1.2 gets error setting camera stage.
before update i had (ver 1.1.1.0)
Code:
aFXCamera.stage = (IntPtr)null;


now after update i have to cast to VIEW
Code:
aFXCamera.stage = (VIEW)(IntPtr)null;


but this crashes in
Code:
/* -------- VIEW -------- */
        /* VIEW to NativeVIEW* (address in void*) */
        public static explicit operator IntPtr(VIEW d)
        {
            unsafe
            {
                return (IntPtr)(NativeVIEW*)d.VIEWPointer; // CRASH HERE!
            }
        }


with an exception:


Last edited by pararealist; 07/28/09 19:48.

A8.3x Commercial, AcknexWrapper and VS 2010 Express
○pararealist now.
Re: C# wrapper - RELEASE 1.1.1.2 [Re: pararealist] #281807
07/28/09 19:47
07/28/09 19:47
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
ah thanks, will fix it and upload a new version, will upload in 10 mins if everyything works as planned!

You also mentioned that you have to cast to view now.
But there are also other possibilities than
aFXCamera.stage = (VIEW)(IntPtr)null;

for example

aFXCamera.stage = (VIEW)null;

aFXCamera.stage = null;

aFXCamera.stage = (VIEW)IntPtr.Zero;

Last edited by Stromausfall; 07/28/09 20:17.

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.2 [Re: Stromausfall] #281808
07/28/09 19:48
07/28/09 19:48
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...
great


A8.3x Commercial, AcknexWrapper and VS 2010 Express
○pararealist now.
Re: C# wrapper - RELEASE 1.1.1.3 [Re: Stromausfall] #281810
07/28/09 19:56
07/28/09 19:56
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
i just uploaded a new version of the wrapper : 1.1.1.3 get it here : http://acknexwrapper.matthias-auer.net
Fixes bug where assigning null to an EngineObject parameter caused an exception.


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] #281817
07/28/09 20:25
07/28/09 20:25
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
i have looked into boo a bit the last two evenings. it kind of is c# with a python-like syntax. i could imagine that it would be quite easy to convert my python wrapper to boo with some simple converter scripts. so maybe there will be a competitor .net wrapper with automatic var handling. :p

it's rather unlikely though since i don't have much time and i am pretty new to .net and all this marshaling stuff. probably unforeseen problems will arise. smile

Re: C# wrapper - RELEASE 1.1.1.3 [Re: Stromausfall] #281818
07/28/09 20:28
07/28/09 20:28
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...
All OK again. This will be a great wrapper, Stolz kannst du sein.


A8.3x Commercial, AcknexWrapper and VS 2010 Express
○pararealist now.
Re: C# wrapper - RELEASE 1.1.1.3 [Re: pararealist] #281821
07/28/09 20:40
07/28/09 20:40
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
@pararealist danke ^^

@ventilator the more, the merrier i would say ^^
Concerning marshalling stuff, you should have a look at the c# wrapper, how it handles marshalling. You will see it's not that hard - actually easy, as .net handles all the difficult stuff ^^ And if you have questions regarding wrapping the acknex engine in c# i will surely help you!
On my end, it doesn't matter if there's a wrapper i have created or you, as long as there is one - i'm happy ^^


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] #281826
07/28/09 21:04
07/28/09 21:04
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Has anyone any experience with runtime evaluation/ execution of strings? What i'm talking about is say you have a string >> "EngVar.sunlight.Intvalue=0" and then being able to process this at runtime, and have C# execute it. I don't think C# has an eval() function at the moment, i think python does though.

This way you could create your own scripting engine allowing the user to change almost anything at runtime.

I'll probably have to wait until C# 4.0 or even 5.0 appears. I think they are exposing the CLR compiler as a set of classes, so you can control what happens at runtime.

Last edited by DJBMASTER; 07/28/09 21:05.
Re: C# wrapper - RELEASE 1.1.1.3 [Re: DJBMASTER] #281829
07/28/09 21:15
07/28/09 21:15
Joined: May 2002
Posts: 7,441
ventilator Offline
Senior Expert
ventilator  Offline
Senior Expert

Joined: May 2002
Posts: 7,441
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();
		}
	}
}



Re: C# wrapper - RELEASE 1.1.1.3 [Re: DJBMASTER] #281831
07/28/09 21:22
07/28/09 21:22
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
This seems to be a hot topic regarding c# ^^
I found two pages which show different approaches :
(evaluation at runtime but sure this would be damn much work to implement, because of the sheer amount of commands)
http://www.codeproject.com/KB/cs/runtime_eval.aspx

and
(compiling at runtime)
http://www.digitalcoding.com/Code-Snippe...e-run-time.html

@ventilator for sure ! delegates are maybe the most interesting part of the wrapper, as one has to keep the references of a delegate until it isn't used anymore ^^

Last edited by Stromausfall; 07/28/09 21:24.

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
Page 12 of 32 1 2 10 11 12 13 14 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