Gamestudio Links
Zorro Links
Newest Posts
folder management functions
by VoroneTZ. 04/16/24 11:18
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
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
7 registered members (VoroneTZ, 11honza11, ricky_k, Nymphodora, rki, 7th_zorro, Volkovstudio), 433 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
[C#] AckNET #443924
07/27/14 23:38
07/27/14 23:38
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline OP
Expert
MasterQ32  Offline OP
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
Hey guys!

Just started a new project today:
AckNET

AckNET is my try to create another C# wrapper for Gamestudio.

I don't want to create a 1:1 wrapper but a logical wrapper that allows you programming in the normal C# style.

You can get the current version of the wrapper at GitHub:
https://github.com/MasterQ32/AckNET/

Please note that the wrapper is in a very early stage (Just started this afternoon) but has already most of the types (Entity, Material, View, Event and Bitmap) wrapped.

Functions are currently missing as well as some global variables.

The wrapper will be developed on feature request or if I am missing features myself.

As the wrapper is a base for another project, it will get most of the common functions in early time but the lesser common functions will stay untouched.

"var" is wrapped with a custom struct named ackvar. It has an implicit operator casting it to and from double, but casting it to bool or int works with explicit casts (this allows better usage in conditionals)

Here is a small example using C# vNext:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AckNET.EngineVars;

namespace AckNET.Test
{
	class Program
	{
		static void Main(string[] args)
		{
			Acknex.Open("-nx 200");
			Console.WriteLine("Using version {0}", EngineVars.Version);

			OnTab = (x) => { Console.WriteLine("Pressed [TAB]"); return 0; };
			MouseMode = 3;

			Level.Load("");

			var ent = new Entity("cargo.mdl", new Vector(550.0, 0.0, 0.0));

			var snd = new Sound("beep.wav");

			OnSpace = (x) => { snd.Play(100, 0); return 0; };

			while (Acknex.Frame())
			{
				if (ent == EngineVars.MouseEnt)
				{
					ent.Pan += 1.5 * TimeStep;
				}

				Camera.Pan += (KeyCul - KeyCur) * TimeStep;

				Console.WriteLine("{0} - {1} -> {2}", KeyCul, KeyCur, (KeyCul - KeyCur));

				if ((bool)MouseLeft)
				{
					Console.WriteLine("{0}:{1}:{2}", (int)SysHours, (int)SysMinutes, (int)SysSeconds);
				}

				if ((bool)KeyEsc)
				{
					break;
				}
			}

			Acknex.Close();
		}
	}
}



Regards
Felix


Visit my site: www.masterq32.de
Re: [C#] AckNET [Re: MasterQ32] #443928
07/28/14 06:16
07/28/14 06:16
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf
KeyCul, KeyCur, => KeyCuL, KeyCuR, to emphasize the direction


"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
Re: [C#] AckNET [Re: Michael_Schwarz] #443941
07/28/14 09:49
07/28/14 09:49
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline OP
Expert
MasterQ32  Offline OP
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
Sounds good. Will do this after every global variable is built in. Autogenerated code doesn't like changes wink


Visit my site: www.masterq32.de
Re: [C#] AckNET [Re: MasterQ32] #444013
07/28/14 21:00
07/28/14 21:00
Joined: Dec 2008
Posts: 1,660
North America
Redeemer Offline
Serious User
Redeemer  Offline
Serious User

Joined: Dec 2008
Posts: 1,660
North America
Looks like a pretty cool project! If I were still using gamestudio I might be inclined to play around with it, but unfortunately that's not the case.


Eats commas for breakfast.

Play Barony: Cursed Edition!
Re: [C#] AckNET [Re: Redeemer] #444059
07/29/14 21:59
07/29/14 21:59
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline OP
Expert
MasterQ32  Offline OP
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
Made commit #11 right now. A important feature was added right now:
Code:
if (ReferenceEquals(ent, EngineVars.MouseEnt))
{
	ent.Pan += 1.5 * TimeStep;
}


All engine objects have now C# reference equality. This is useful for any referencing and won't cause problems with external libraries.


Visit my site: www.masterq32.de
Re: [C#] AckNET [Re: MasterQ32] #444107
07/30/14 12:57
07/30/14 12:57
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline OP
Expert
MasterQ32  Offline OP
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
Added first c_trace version and a simple fluent interface to vector.

Code:
private void EngineVars_OnMouseLeft(object sender, EngineEventArgs e)
{
	if (Collision.Trace(
		EngineVars.MousePos.SetZ(0).ForScreen(EngineVars.Camera),
		EngineVars.MousePos.SetZ(1000).ForScreen(EngineVars.Camera),
		CollisionFlags.UsePolygon | CollisionFlags.IgnoreSprites | CollisionFlags.IgnorePassable | CollisionFlags.IgnorePassents,
		out ackvar distance))
	{
		clicks.Add(EngineVars.Hit.Position);
	}
}




Visit my site: www.masterq32.de
Re: [C#] AckNET [Re: MasterQ32] #444119
07/30/14 18:21
07/30/14 18:21
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
sys_... vars demand an own class tongue

Re: [C#] AckNET [Re: FBL] #444123
07/30/14 19:33
07/30/14 19:33
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline OP
Expert
MasterQ32  Offline OP
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
Most of the sys_ variables are also available in "better" via C# class libraries wink
Like Environment, DateTime and Screen...


Visit my site: www.masterq32.de
Re: [C#] AckNET [Re: MasterQ32] #444156
07/31/14 22:28
07/31/14 22:28
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline OP
Expert
MasterQ32  Offline OP
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
After a little bit of work, AckNET now documents its wrapper functionality itself:


Nice feature i think, i'll add a wrapper completeness calculator as well...


Visit my site: www.masterq32.de
Re: [C#] AckNET [Re: MasterQ32] #444164
08/01/14 07:58
08/01/14 07: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...
A few minor mistakes?
ent_setskin -> Entity.GetSkin = mistake. should be Entity.SetSkin
ent_type -> Entity.get_Type why get_Type and not getType ? conformity.


A8.3x Commercial, AcknexWrapper and VS 2010 Express
○pararealist now.
Page 1 of 3 1 2 3

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