DirectDraw High Color Considerations

Fastgraph normally implements high color virtual buffers using the 5/6/5 pixel format to encode RGB color values. For high color drawing surfaces, however, some DirectDraw implementations require a 5/5/5 pixel format. When you create a high color virtual buffer in a DirectDraw program, Fastgraph will first attempt to use the 5/6/5 pixel format, but if the particular DirectDraw implementation does not support it, Fastgraph will instead use the 5/5/5 pixel format.

If you use Fastgraph functions to retrieve or display pixel values in high color DirectDraw programs, the pixels will always be in the selected format. For example, fg_maprgb() will convert color components to a 5/6/5 encoded pixel value if using the 5/6/5 pixel format, but it will convert them to a 5/5/5 encoded value if using the 5/5/5 format. However, problems can arise if you use hard-coded 5/6/5 pixel values (as in the Dcb example) in high color DirectDraw programs. To make DirectDraw programs work correctly with either high color pixel format, you should avoid using hard-coded pixel values and let Fastgraph choose the proper RGB encoding.

<< Prev

Next >>

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.