RenderWare V2.1

Previous Page Index Next Page

RwBool

RwOpenExt(char *devname, void *param, RwInt32 numargs,
RwOpenArgument *args);

Arguments

devname The device name as a null-terminated string. Names currently supported under MS DOS are:

"DOS"
"DOSMOUSE"
"NullDevice"

The "NullDevice" driver allows the library to be used when output to a display is not required (for instance, when reading from or writing to files).

"DOSMOUSE" will open the library with the mouse driver active. This will mean that the library can only be accessed if a Microsoft compatible mouse driver is not required.

"DOS" performs the same function as "DOSMOUSE" except the mouse is not accessed, and so a mouse driver is not required.

param param should be set to a pointer to an RwInt32. The long will be set to an error code if the library cannot be opened. See RwOpen() for details.

numargs The number of optional arguments specified.

args An array of optional open arguments.

Comments

As discussed in "RenderWare Library Configuration", RwOpenExt() does not read the RenderWare initialization file dosrw.ini. Library configuration control is achieved by specifying a number of additional arguments to RwOpenExt().

RwOpenExt() takes a pointer to an array of RwOpenArgument structures. RwOpenArgument is defined as follows:

typedef struct
{
RwOpenOption option;
void *value;
} RwOpenArgument;

option is one of the identifiers defined below and value is a parameter specific to the option type. If the parameter type is integer, the integer value should be cast to a void *.

For example:

args[0].value = (void *)10;

The configuration options supported under MS DOS are:

• rwGAMMACORRECT Controls whether RenderWare performs gamma correction on its color palette. value should be non-zero to enable gamma correction, and zero to disable gamma correction.

• rwSCRWIDTH Requests a video mode of the graphics adapter with a width of value.

• rwSCRHEIGHT Requests a video mode of the graphics adapter with a height of value.

• rwSCRDEPTH Requests a video mode of the graphics adapter with a depth of value.

The following example demonstrates opening the RenderWare library with a resolution of 640 by 480 in 8-bit color.

RwOpenArgument args[3];
LONG nERROR;

args[0].option = rwSCRWIDTH;
args[0].value = (void *)640;
args[1].option = rwSCRHEIGHT;
args[1].value = (void *)480;
args[2].option = rwSCRDEPTH;
args[2].value = (void *)8;

RwOpenExt("DOSMOUSE", &nERROR, 3, args);