|
Snippet: Using c# to make an engine EXE
#111518
02/09/07 21:29
02/09/07 21:29
|
Joined: Mar 2001
Posts: 3,298 Beverly, Massachusetts
Rhuarc
OP
Expert
|
OP
Expert
Joined: Mar 2001
Posts: 3,298
Beverly, Massachusetts
|
Just a code snippet that should allow you to open the engine through Acknex.DLL in a C# application . Of course, this does not get the ENGINE_VARS struct yet, but that's easy to add . Code:
[DllImport("acknex.dll")] static extern void engine_open(char[] commandline,int callback);
public MyA6App() { InitializeComponent(); engine_open("level.wmb".ToCharArray(), 0); }
The same proceedure for using Acknex.dll goes for the c# app, you've gotta run WED.EXE -p [wdl] [exePath] Ooooh boy... *cracks fingers* I might actually get something done with this engine again. C++ was just too clumsy of an interface with the engine... I'm a fan of being able to use Windows.Forms inline with A6 . -Rhuarc
|
|
|
Re: Snippet: Using c# to make an engine EXE
[Re: Rhuarc]
#111523
02/10/07 09:59
02/10/07 09:59
|
Joined: Aug 2006
Posts: 652 Netherlands
bstudio
User
|
User
Joined: Aug 2006
Posts: 652
Netherlands
|
Yay, no need for stupid complex C++ window handling anymore, time for some C# coding
BASIC programmers never die, they GOSUB and don't RETURN.
|
|
|
Re: Snippet: Using c# to make an engine EXE
[Re: MichaelGale]
#111525
02/10/07 17:05
02/10/07 17:05
|
Joined: Mar 2001
Posts: 3,298 Beverly, Massachusetts
Rhuarc
OP
Expert
|
OP
Expert
Joined: Mar 2001
Posts: 3,298
Beverly, Massachusetts
|
Quote:
@Rhuarc: Yes... but try to use it in C# and you'll see the problems. WinForms offers functions to convert these Window handles to the Form type, but produces an error if you run the application
Hmm... I haven't had any errors... but I'm not getting any results either. 'tis odd... although, I wonder if you can nab the d3d device and switch it with a device window within a c# app while the engine isn't looking- so it starts rendering there instead.. the problem is getting the unmanaged dx9 api to run in a c# app instead of managed dx9.... hmmm... memory hacks! (rofl)
-Rhuarc
|
|
|
|