Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by M_D. 04/26/24 20:22
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 839 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Use acknex.dll with Visual Studio 2005 #147643
08/13/07 03:06
08/13/07 03:06
Joined: Sep 2003
Posts: 208
Michael_McCrickard Offline OP
Member
Michael_McCrickard  Offline OP
Member

Joined: Sep 2003
Posts: 208
The tutorial on using the engine dll, acknex.dll, doesn't give the same kind of step by step instructions as the tutorial on creating your own DLLs that are used by the engine. And I'm stuck trying to make this work. I create a Win32 project (and link acknex.lib and do the other library stuff specified in the tutorial, I also copy the engine files to my project directory), I replace the default script it provides with the one in the tutorial and try to compile. First it complains that I haven't included "stdafx.h", so I do that. Then when I compile it acts like it doesn't know what a UINT is! And then a bunch of errors related the ENGINE_ type. I must be doing something really basic wrong.

Last edited by Michael_McCrickard; 08/13/07 14:02.
Re: Use acknex.dll with Visual Studio 2005 [Re: Michael_McCrickard] #147644
08/13/07 14:04
08/13/07 14:04
Joined: Sep 2003
Posts: 208
Michael_McCrickard Offline OP
Member
Michael_McCrickard  Offline OP
Member

Joined: Sep 2003
Posts: 208
Can anyone whoe has compiled one of the engine lessons successfully at least tell me which compiler you used? And anything else about your settings that might not be specified in the tutorial?

Re: Use acknex.dll with Visual Studio 2005 [Re: Michael_McCrickard] #147645
08/13/07 14:41
08/13/07 14:41
Joined: Sep 2003
Posts: 208
Michael_McCrickard Offline OP
Member
Michael_McCrickard  Offline OP
Member

Joined: Sep 2003
Posts: 208
Figured it out. Here's the version you need for VS 2005. Just substitute your project name for "yourProjectName".

// yourProjectName.cpp : Defines the entry point for the application.
//

#include "stdafx.h"
#include "yourProjectName.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>

// Include the engine data types, variables, and functions
#include "adll.h"

int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{

engine_open("hut1.wmb");

// The engine_open() function initializes the GameStudio engine,
// and accepts a command line string with the name of a script,
// or an entity file to be loaded upon initialization. For instance,
// we could hand over the application command line (char*)lpCmdLine.
// We could also pass options to start in client or server mode.
// Here we're just loading the arena level.

// After loading a level we're ready to render it. The engine_frame()
// function executes the scripts and physics, and renders the
// current camera position to the screen if a level is loaded.
// The function returns zero when a script calls exit() or an Abort
// button is clicked.

while (engine_frame());

// For rendering the level, we are just repeating engine_frame() until
// a 0 value is returned. This is normally our main loop, all
// the interesting stuff happens here. However, when an entity file
// name is given for engine_open(), the engine acts as a viewer.
// A default walkthrough movement is activated and we don't want
// to do anything else at the moment.

engine_close();

// Someone pressed the Exit icon. Our application is about to end.
// Before that, the engine must be closed by engine_close().

return 0;

}

Re: Use acknex.dll with Visual Studio 2005 [Re: Michael_McCrickard] #147646
08/13/07 17:26
08/13/07 17:26
Joined: Mar 2007
Posts: 75
Hamburg, Ger
Altimeter Offline
Junior Member
Altimeter  Offline
Junior Member

Joined: Mar 2007
Posts: 75
Hamburg, Ger
Thank you Michael for that fine tutorial.
Now I finally understood the sequence how rendering works with the engine included as dll.

Re: Use acknex.dll with Visual Studio 2005 [Re: Altimeter] #147647
08/14/07 14:56
08/14/07 14:56
Joined: Sep 2003
Posts: 208
Michael_McCrickard Offline OP
Member
Michael_McCrickard  Offline OP
Member

Joined: Sep 2003
Posts: 208
Thanks and I wish I could take credit for all the info! This actually comes from the GameStudio Help file (see C++/SDK Programming -> Enging Programming) What I did was modify the code part just a little bit to get it to work as a Windows app. Now does anyone know if you can make this method work as a console app?

Re: Use acknex.dll with Visual Studio 2005 [Re: Michael_McCrickard] #147648
08/16/07 13:48
08/16/07 13:48
Joined: Apr 2006
Posts: 136
San Francisco
T
Tor Offline
Member
Tor  Offline
Member
T

Joined: Apr 2006
Posts: 136
San Francisco
I don't think so... unless your just trying to use some of the a6 header info's? Like vector or whatever? It's gonna need the windowz code to make the window...

I've been using vs2003 with a6 exclusively. Running it in engine mode (using the liteC headers). It's very fast and powerful (typecasting vars is a pain in the butt tho, but doable).


"Towlie, you're the worst character ever." I know...
Re: Use acknex.dll with Visual Studio 2005 [Re: Tor] #147649
08/16/07 14:28
08/16/07 14:28
Joined: Sep 2003
Posts: 208
Michael_McCrickard Offline OP
Member
Michael_McCrickard  Offline OP
Member

Joined: Sep 2003
Posts: 208
I just suceeded in getting this the engine mode to work both as a regular Windows .exe app and also as an MFC app. I'm experimenting and trying to find the right approach for integrating my editing system (a separate app) into the game. Can you explain what you mean by typecasting the vars? I haven't tried to declare and use any vars in this engine mode yet.

BTW, I recently upgraded from VS 2003 to VS 2005 and I wish I had done it sooner. One of the biggest advantages is how quickly it will start up your app in debug mode (compared to VS2003). In fact, after the first debug run, it seems like it can start up in debug just as fast as regular mode.

Another thing that is really cool is the "tooltips" in debug mode (datatips?). They actually have little treeview controls embedded in them, so if you pass your cursor over an object variable, you can see all of it's properties and if it has an object embedded in it, you can expand it and see those props too. And the help system works much better -- you tell it to filter on Visual C++, and that's what you get! I found VS2005 at softwaresurplus.com for $125.


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