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:
- Can only be called from an external application, not from a script or plugin.
- The engine must be closed through engine_close(). It can be opened and closed repeatedly
when no script is given in the command line.
- No engine variable or other engine function except engine_status can be used before opening or after closing the engine.
#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