engine_open (char* commandline)
Opens the engine (acknex.dll) and passes a command line string to
it.
Parameters:
commandline
- char* string that contains a level or script to load and/or any command
line parameters, or NULL.
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, but open and close calls must
not be nested.
Example:
#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");
while (engine_frame());
engine_close();
return 0;
}
See also:
Command Line, Programming
Lesson, engine_close, engine_frame