Next: , Previous: Real type, Up: BP Incompatibilities



7.2.6 Graph unit

A mostly BP compatible Graph unit exists as part of the GRX package. It is known to work under DJGPP, Cygwin, mingw, Linux/IA32 with svgalib, and should work under any Unix system with X11 (tested under Linux, Solaris, AIX, etc.).

There is a small difference in the color numbering, but it should be easy to work-around: You can't assume, e.g., that color 1 is always blue, and 2 is green, etc. On a system with 15 or more bits of color depth (i.e., 32768 or more colors, which most PCs today have), they will all be very dark shades of blue. This is not really a bug, but simply a property of modern high-color modes (whereas BP's Graph unit was only designed for 16 and 256 color modes).

However, the names Blue, Green etc. stand for the correct colors in the Graph unit of GRX. They are no constants, but functions (because the color depth is in general not known until runtime), so you can't use them in contexts where constants are expected. Also, they might conflict with the identifiers of the CRT unit if you use both units at the same time. If you want to use computed color values in the range 0 ... 15, you can translate them to the correct colors using the EGAColor function.