Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
M1 Oversampling
by 11honza11. 04/20/24 20:57
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 533 guests, and 2 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 21 of 32 1 2 19 20 21 22 23 31 32
Re: C# wrapper - RELEASE 1.1.1.2 [Re: DJBMASTER] #303279
12/27/09 17:19
12/27/09 17:19
Joined: Nov 2009
Posts: 27
A
aenkku Offline
Newbie
aenkku  Offline
Newbie
A

Joined: Nov 2009
Posts: 27
Very cool endeed smile

Re: C# wrapper - RELEASE 1.1.1.2 [Re: Stromausfall] #305980
01/18/10 20:15
01/18/10 20:15
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Hey Stromausfall, I'm in need to customize the wrapper a little bit so I can access some of the parameters of the Native structs.

Specifically I need to get the 'dy' member of the NativeFont struct. I tried adding this to the 'FONT' class...
Code:
private Var dy_ = null;
        public Var dy
        {
            get
            {
                unsafe
                {
                    if (dy_ == null)
                    {
                        dy_ = (Var)(IntPtr)(&((*FONTPointer).dy));
                    }
                }
                return dy_;
            }
        }


...yet I'm always getting 0, where as testing in lite-c gives me the value of 20.

Last edited by DJBMASTER; 01/19/10 00:13.
Re: C# wrapper - RELEASE 1.1.1.2 [Re: DJBMASTER] #306164
01/20/10 09:10
01/20/10 09:10
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
hi!
the problem in your code snippet was, that dy is an int not a var (open the NativeFONT.cs to see what type a variable has)! This snippet should work.
Code:
/// <summary>
        /// dy - see Gamestudio manual
        /// </summary>
        public int dy
        {
            get
            {
                unsafe
                {
                    return (*FONTPointer).dy;
                }
            }
        }


Maybe I will include some unlisted properties of engine objects in the next release (which I will release, when the new engine version isn't in public beta anymore)

Re: C# wrapper - RELEASE 1.1.1.2 [Re: Stromausfall] #306165
01/20/10 09:15
01/20/10 09:15
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
ahh didn't notice that, I did a quick copy & paste from ENTITY* for the x member and assumed it would work, lol. I really need to start looking properly, lol.

Thanks again.

Last edited by DJBMASTER; 01/20/10 09:15.
Re: C# wrapper - RELEASE 1.1.1.2 [Re: DJBMASTER] #306800
01/25/10 01:06
01/25/10 01:06
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
The member 'matrix' is missing from the 'MATERIAL' struct. I need this variable for the function 'mat_set'. Could you please add a definition for it?

Edit>>> While we're on the subject of material, I think there may be a bug floating about somewhere. I'm trying to apply the shader 'envglass.fx' from the 'GStudio7\Code' folder to a model...
Code:
MATERIAL mat_ent = EngFun.mtl_create();
ENTITY entity = EngFun.ent_create("blob.mdl", new Vector(150, 0, 0), null);
mat_ent.skin1 = EngFun.bmap_create("t_day_sky+6.tga");
entity.material = mat_ent;
entity.SHOW = true;

EngFun.bmap_to_cubemap(mat_ent.skin1);
EngFun.effect_load(mat_ent, "envglass.fx");


The shader also needs 'default.fx' from 'GStudio7\Include'. The same code works fine in lite-c. I think it may have something to do with the 'mat_ent.skin1' as the shader uses this skin, and modifying the shader to use a skin embedded with the .mdl, works fine.

Last edited by DJBMASTER; 01/25/10 04:07.
Re: C# wrapper - RELEASE 1.1.1.2 [Re: DJBMASTER] #306904
01/25/10 18:23
01/25/10 18:23
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
hi!
in fact i already implemented some kind of mechanism to access this 'matrix', but as I now tried it myself, I had to recognize, that it doesn't work and is not that handy....
Thus I will implement a class 'MATRIX' (just like 'ENTITY' or 'VIEW), that offers function to get it's matrix as float[][] or set it with a float[][] and functions or properties to access each part of the matrix, like matrix41...
It's necessary to implement the matrix itself as class, as the engine functions can only access unmanaged memory, and thus the class will wrap a float[][] matrix in the unmanaged space of the application.

Concerning the bug - I tried your example and found only one difference between the wrapper and the lite-c version (i used the "sf_woman.mdl" as model and "skycube+6.tga" as bmap, both from the template folder) - the lite-c version gave me warnings, that "SKIN#01 - normal or height map missing" and that one 3 times! As I'm a real newbie in shader programming, this doesn't have to mean anything smirk
What was the error that occurred in your application ? What did differ between the lite-c and the c# version ?

I will fix the wrapper on the weekend - as I don't have that much time during this week ^^

Thanks in advance for your help in spotting down that error!


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] #306943
01/26/10 00:20
01/26/10 00:20
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
The shader simply didn't work in C#. I broke the code down in lite-c, and by not setting material.skin1 to the sky-cube map, then the shader appears like it does in C#, thus I can only assume that material.skin1 is'nt being assigned correctly or something.

That 'SKIN#01' error is caused because that particular shader uses additional skins. You can use 'box.mdl' from 'GStudio7\Projects\shadertest' which has all the skins attached as required.

Here is a demo in lite-c...

http://djbm.kawanda.net/Public/ShaderTest.zip

Re: C# wrapper - RELEASE 1.1.1.2 [Re: DJBMASTER] #307069
01/26/10 21:16
01/26/10 21:16
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
Thank you for the sample project!
I've tried to rebuild that project in C# and it seems to me that it works just like the lite-c version.
I've uploaded the project (with a compiled version in the Debug folder)

http://www.matthias-auer.net/acknexwrapper/WrapperTestApp.zip

hmmmm, I wasn't able to see any difference between the lite-c and the c# version frown


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] #307104
01/27/10 08:46
01/27/10 08:46
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Ahh, it seems that the shader editor for my application, was using an older version of the wrapper. I haven't worked on the shader part in a long time so I guess I just forgot to update it. It's working fine now.

Thanks for once again bailing me out of trouble, lol.

Re: C# wrapper - RELEASE 1.1.1.2 [Re: DJBMASTER] #307107
01/27/10 08:52
01/27/10 08:52
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
No problem ^^
I hope to be able to upload a new version of the wrapper which supports Matrix operations this weekend!


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 21 of 32 1 2 19 20 21 22 23 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