Using the VGAPAL.DRV Display Driver

The VGAPAL.DRV display driver operates as a standard 16-color VGA driver with a custom color table defined by an application. VGAPAL.DRV uses the SETCOLORTABLE escape to define the colors used for the display.

About VGAPAL.DRV Display Modes

For default operation, VGAPAL.DRV operates as a standard VGA driver with the default 16-color palette. That is, if your application uses palette functions, GDI matches the color being requested to one of the standard VGA colors. When a custom color table is used, dithering of colors is disabled. All requested colors are matched to the nearest color in the custom color table.

When VGAPAL.DRV is used with a custom color table, it provides the best display when used as a maximized window. When used this way, your application can change the colors without being concerned about the color shifts introduced in the Windows environment and in other applications using the display.

Detecting VGAPAL.DRV

To detect VGAPAL.DRV, your application should check for a 16-color driver that supports the SETCOLORTABLE escape. The following fragment does this:

        i = SETCOLORTABLE;
        fVgaPal = (GetDeviceCaps(hdc, NUMCOLORS)==16) &&
                Escape(hdc, QUERYESCSUPPORT, sizeof(int), (LPVOID)&i, NULL);

Your application might also check for a palettized driver. While this check will not uniquely identify VGAPAL.DRV, you can use the result to determine if you can use functions for palette operations. VGAPAL.DRV is not a palettized driver so your application cannot use the palette functions with it. The following frament interrogates a device driver to determine if it is a palletized driver:

 fPalette = GetDeviceCaps(hdc, RASTERCAPS) & RC_PALETTE;