RenderWare V2.1

Previous Page Index Next Page

RwBool

RwGetDeviceInfo(RwDeviceInfo info, void *value, RwInt32 size)

Comments

The MS DOS specific aspects of each device information type are as follows;

• rwSCRDEPTH The depth (in bits) of the resolution that the VGA adapter is in.

• rwSCRWIDTH The width (in pixels) of the resolution the VGA adapter is in.

• rwSCRHEIGHT The height (in pixels) of the resolution the VGA adapter is in.

• rwINDEXEDRENDERING As the generic RwGetDeviceInfo().

• rwPALETTEBASED Rendering is palette based if and only if the video adapter is running in a palette based mode. This will normally be the case if the video adapter is in 8-bit (256) color mode. In other modes rendering will not be palette based.

• rwVESAGETDACSIZE Gets the current DAC (digital to analogue converter) size in bits. The DAC size can be either 8 or 6 bits. The parameter should point to a RwInt32 which will receive the DAC size.

The following example finds the current DAC size

{
RwInt32 size;
RwGetDeviceInfo(rwVESAGETDACSIZE, &size, sizeof(size));
}

• rwVESAGETINFO Gets the VESA information block for the currently used VESA mode. This structure contains a detailed description of the video mode. param1 should point to a RwVESAInfo pointer which will receive the pointer to the RwVESA structure. If the mode has no associated VESA block (because it is not a VESA mode) the pointer will be set to NULL.

The following example displays the window granularity for all of the available video modes.

{
RwInt32 i;
RwInt32 nummodes;
RwVESAInfo *info;

RwGetDeviceInfo(rwGETNUMVIDEOMODES, &nummodes,
sizeof(nummodes));

for (i=0; i < nummodes; i++)
{
RwGetDeviceInfo(rwVESAGETINFO, i,
&info, sizeof(info));

/* If its NULL then this isnt a VESA mode */

if (info)
{
printf("Mode : %d Page Granularity : %d \n",
i, info->nWinGranularity);
}
else
{
printf("Mode : %d Isn't a VESA mode \n", i);
}
}
}

• rwGETMOUSESTATE Gets the current status of the mouse - if it is installed or not. param1 should point to an RwBool which will receive TRUE if the mouse is correctly installed and FALSE otherwise.

The following example finds the current mouse status:

{
RwBool status;

RwGetDeviceInfo(rwGETMOUSESTATE, &status,
sizeof(status));

if (status)
{
printf("The mouse is installed\n");
}
else
{
printf("The mouse is not installed\n");
}
}

The following options apply when the output device is palette based:

• rwPALETTE Returns a pointer to a table of 256*3 characters. Each set of consecutive three characters constitutes a color in the form (red, green, blue). That is the first character is the red intensity of the color, the second green and the third blue. The first triple is for color zero. The next for color one etc.

• rwPALETTESIZE As the generic RwGetDeviceInfo().

• rwLASTPALETTEENTRY As the generic RwGetDeviceInfo().

• rwFIRSTPALETTEENTRY As the generic RwGetDeviceInfo().