engine_open (char* commandline)

Opens the engine (acknex.dll) and passes a command line string to it.

Parameters:

commandline - normally NULL. Alternatively, a level or model to view, a script to compile or run, and/or any other command line parameters can be given.

Returns:

Pointer to an ENGINE_VARS struct that contains all engine variables in avars.h, or NULL when acknex.dll could not be found.

Remarks:

Example (see also programming lesson):

#define WIN32_LEAN_AND_MEAN		
#include <windows.h>
#include <stdlib.h>

#include "adll.h"

int APIENTRY WinMain(HINSTANCE hInstance,	// application instance handle
                     HINSTANCE hPrevInstance, // always zero
                     LPTSTR    lpCmdLine,	// application command line
                     int       nCmdShow)	// window flags
{
	engine_open("arena.wmb"); // engine opens as viewer for arena.wmb (physics and script disabled)
	while (engine_frame()); 
	engine_close();
	return 0;
}
                

See also:

Command Line, Programming Lesson, engine_close, engine_frame, engine_status

► latest version online