TP compatible unit to handle screen graphics.

This document describes the GRAPH unit for Free Pascal, for all platforms. The unit was first written for dos by Florian Klaempfl, but was later completely rewritten by Carl-Eric Codere to be completely portable. The unit is provided for compatibility only: It is recommended to use more modern graphical systems. The graph unit will allow to recompile old programs. They will work to some extent, but if the application has heavy graphical needs, it's recommended to use another set of graphical routines, suited to the platform the program should work on.

Requirements

The unit Graph exports functions and procedures for graphical output. It requires at least a VGA-compatible Card or a VGA-Card with software-driver (min. 512Kb video memory).

A word about mode selection

The graph unit was implemented for compatibility with the old Turbo Pascal graph unit. For this reason, the mode constants as they were defined in the Turbo Pascal graph unit are retained.

However, since

  1. Video cards have evolved very much
  2. Free Pascal runs on multiple platforms

it was decided to implement new mode and graphic driver constants, which are more independent of the specific platform the program runs on.

In this section we give a short explanation of the new mode system. the following drivers were defined:

D1bit = 11; D2bit = 12; D4bit = 13; D6bit = 14; { 64 colors Half-brite mode - Amiga } D8bit = 15; D12bit = 16; { 4096 color modes HAM mode - Amiga } D15bit = 17; D16bit = 18; D24bit = 19; { not yet supported } D32bit = 20; { not yet supported } D64bit = 21; { not yet supported } lowNewDriver = 11; highNewDriver = 21;

Each of these drivers specifies a desired color-depth.

The following modes have been defined:

detectMode = 30000; m320x200 = 30001; m320x256 = 30002; { amiga resolution (PAL) } m320x400 = 30003; { amiga/atari resolution } m512x384 = 30004; { mac resolution } m640x200 = 30005; { vga resolution } m640x256 = 30006; { amiga resolution (PAL) } m640x350 = 30007; { vga resolution } m640x400 = 30008; m640x480 = 30009; m800x600 = 30010; m832x624 = 30011; { mac resolution } m1024x768 = 30012; m1280x1024 = 30013; m1600x1200 = 30014; m2048x1536 = 30015; lowNewMode = 30001; highNewMode = 30015;

These modes start at 30000 because Borland specified that the mode number should be ascending with increasing X resolution, and the new constants shouldn't interfere with the old ones.

The above constants can be used to set a certain color depth and resultion, as demonstrated in the below example.

If other modes than the ones above are supported by the graphics card, you will not be able to select them with this mechanism.

For this reason, there is also a 'dynamic' mode number, which is assigned at run-time. This number increases with increasing X resolution. It can be queried with the getmoderange call. This call will return the range of modes which are valid for a certain graphics driver. The numbers are guaranteed to be consecutive, and can be used to search for a certain resolution, as in the second example below.

Thus, the getmoderange function can be used to detect all available modes and drivers, as in the third example below:

Target specific issues: DOS

VESA modes (i.e., anything but 320x200x256 and 640x480x16) do not work under most installations of Windows NT, Windows 2000 and Windows XP. They also do not work for some people under Windows 98 and Windows ME, depending on their graphics drivers. However, the graph unit cannot detect this, because no errors are returned from the system. In such cases, the screen simply turns black, or will show garbage.

Nothing can be done about this, the reason is missing or buggy support in the graphics drivers of the operating system.

Target specific issues: Windows

The windows version of the Graph units is not very performant. It works, thus allowing to port old TP programs to Windows, but that is all what can be expected from it. Further, it is windowed only: A separate window is opened in which the graphics are displayed. This means that the normal keyboard/mouse handling as provided by the crt and/or keyboard/mouse units wil not work in the graphical window. If keyboard and mouse input are needed the winmouse and the wincrt unit should be used instead. To hide the console window, compile with the

{$apptype gui}

switch.

Further, the following extra modes are available:

mLargestWindow16 = $f0; mLargestWindow256 = $f1; mLargestWindow32k = $f2; mLargestWindow64k = $f3; mLargestWindow16M = $f4; mMaximizedWindow16 = $f5; mMaximizedWindow256 = $f6; mMaximizedWindow32k = $f7; mMaximizedWindow64k = $f8; mMaximizedWindow16M = $f9;
Target specific issues: Linux

There are several issues on Linux that need to be taken care of:

The Linux version of the Graph unit uses the libvga library. This library works on the console, not under X.

If you get an error similar to

/usr/bin/ld: cannot find -lvga

This can mean one of two things: either libvga and it's development package is not installed properly, or the directory where it is installed is not in the linker path.

To remedy the former, you should install both the libvga package and libvga-devel package (or compile and install from scratch).

To remedy the latter, you should add the path to the compiler command-line using the -Fl option.

Programs using libvga need root privileges to run. You can make them setuid root with the following command:

chown root.root myprogram chmod u+s myprogram

The libvga library will give up the root privileges after it is initialized.

there is an experimental version of the Graphics library available that uses GGI to do all the drawing, but it is not well tested. It's called ggigraph and is distributed in source form only.

Do not use the CRT unit together with the Graph unit: the console may end up in an unusable state. Instead, the ncurses unit may function fine.

Categorized functions: Initialization

Initialization of the graphics screen.

NameDescription
Empty the graphics screen
Finish drawing session, return to text mode
Detect graphical modes
Get aspect ratio of screen
Get range of valid modes for current driver
Set defaults
Return name of graphical driver
Return current or last used graphics mode
Get maximum mode for current driver
Get name of current mode
String representation of graphical error
Result of last drawing operation
Initialize graphics drivers
Install a new driver
Register a new driver
Go back to text mode
Set graphical mode
Categorized functions: Screen management

General drawing screen management functions.

NameDescription
Clear the current viewport
Copy image from screen to memory
Get maximum X coordinate
Get maximum Y coordinate
Get current X position
Get current Y position
Get size of selected image
Get current viewport settings
Copy image from memory to screen
Set active video page
Set aspect ratio for drawing routines
Set current viewport
Set visual page
Set write mode for screen operations
Categorized functions: Color management

All functions related to color management.

NameDescription
Get current background color
Get current foreground color
Get default palette entries
Get maximum valid color
Get size of palette for current mode
Get color of selected pixel
Get palette entry
Set all colors in palette
Set background color
Set foreground color
Set palette entry
Set palette entry with RGB values
Categorized functions: Drawing primitives

Functions for simple drawing.

NameDescription
Draw an arc
Draw a complete circle
Draw a polygone with N points
Draw an ellipse
Get arc coordinates
Get current line drawing settings
Draw line between 2 points
Draw line relative to current position
Draw line from current position to absolute position
Move cursor relative to current position
Move cursor to absolute position
Draw a pie slice
Draw 1 pixel
Draw a non-filled rectangle
Draw a sector
Set current line drawing style
Categorized functions: Filled drawings

Functions for drawing filled regions.

NameDescription
Draw a filled 3D-style bar
Draw a filled rectangle
Fill starting from coordinate
Draw a filled ellipse
Draw a filled polygone
Get current fill pattern
Get current fill settings
Set current fill pattern
Set current fill settings
Categorized functions: Text and font handling

Functions to set texts on the screen.

NameDescription
Get current text settings
Install a new font
Write text at current cursor position
Write text at coordinates X,Y
Register a new font
Set text justification
Set text style
Set text size
Calculate height of text
Calculate width of text
Describe the last arc which was drawn on screen Center X coordinate Center Y coordinate Drawing segment start X coordinate Drawing segment start Y coordinate Drawing segment end X coordinate Drawing segment end Y coordinate Bit pattern used when drawing lines. Set bits are drawn. Record describing fill mode Fill bit pattern. Set bits are drawn.. Color used to fill Record describing current line drawing mode Line style used when drawing. Pattern used when drawing. Line width used when drawing. Record describing palette RGB color Red component of color Green component of color Blue component of color Record describing palette. Actual size of palette (number of entries) Color entries in palette. Record describing a point in a 2 dimensional plane X coordinate Y coordinate Record describing how texts are drawn. TextSettingsType = Record Font,Direction, CharSize, Horiz, Vert : Word end; Font used. Direction in which to write. Font size Horizontal justification Vertical justification Record describing a viewport X coordinate of upper-left corner. X coordinate of lower-right corner. Y coordinate of upper-left corner. Y coordinate of lower-right corner. Should drawing be clipped to the current rectangle? Draw part of a circle Arc draws part of a circle with center at (X,Y), radius radius, starting from angle start, stopping at angle stop. These angles are measured counterclockwise. None. Draw filled rectangle Draws a rectangle with corners at (X1,Y1) and (X2,Y2) and fills it with the current color and fill-style. None. , Draw filled 3-dimensional rectangle

Bar3d draws a 3-dimensional Bar with corners at (X1,Y1) and (X2,Y2) and fills it with the current color and fill-style. Depth specifies the number of pixels used to show the depth of the bar.

If Top is true; then a 3-dimensional top is drawn.

None.
Draw a complete circle Circle draws a complete circle with center at (X,Y), radius radius. None. Clear the complete screen Clears the graphical screen (with the current background color), and sets the pointer at (0,0). None. Clear the current viewport Clears the current viewport. The current background color is used as filling color. The pointer is set at (0,0). None. Close graphical system. Closes the graphical system, and restores the screen modus which was active before the graphical modus was activated. None. Detect correct graphical driver to use DetectGraph checks the hardware in the PC and determines the driver and screen-modus to be used. These are returned in Driver and Modus, and can be fed to InitGraph. See the InitGraph for a list of drivers and modi. None. Draw a polygone DrawPoly draws a polygone with NumberOfPoints corner points, using the current color and line-style. PolyPoints is an array of type . None. Draw an ellipse Ellipse draws part of an ellipse with center at (X,Y). XRadius and Yradius are the horizontal and vertical radii of the ellipse. Start and Stop are the starting and stopping angles of the part of the ellipse. They are measured counterclockwise from the X-axis (3 o'clock is equal to 0 degrees). Only positive angles can be specified. None. Draw and fill an ellipse Ellipse draws an ellipse with center at (X,Y). XRadius and Yradius are the horizontal and vertical radii of the ellipse. The ellipse is filled with the current color and fill-style. None. Draw, close and fill a polygone FillPoly draws a polygone with NumberOfPoints corner points and fills it using the current color and line-style. PolyPoints is an array of type PointType. None. Fill an area with a given color Fills the area containing the point (X,Y), bounded by the color BorderColor. None Return coordinates of last drawn arc or ellipse. GetArcCoords returns the coordinates of the latest Arc or Ellipse call. None. Return screen resolution GetAspectRatio determines the effective resolution of the screen. The aspect ration can then be calculated as Xasp/Yasp. None. Return current background color GetBkColor returns the current background color (the palette entry). None. Return current drawing color GetColor returns the current drawing color (the palette entry). None. Return default palette GetDefaultPalette returns the current palette in Palette. None. Return current driver name GetDriverName returns a string containing the name of the current driver. None. Return current fill pattern GetFillPattern returns an array with the current fill-pattern in FillPattern None Return current fill settings GetFillSettings returns the current fill-settings in FillInfo None. Get current graphical modus GetGraphMode returns the current graphical modus None. Return a copy of a screen area GetImage Places a copy of the screen area (X1,Y1) to X2,Y2 in BitMap Bitmap must have enough room to contain the image. , Get current line drawing settings GetLineSettings returns the current Line settings in LineInfo None. return maximum number of colors GetMaxColor returns the maximum color-number which can be set with SetColor. Contrary to Turbo Pascal, this color isn't always guaranteed to be white (for instance in 256+ color modes). None. , Return biggest mode for the current driver GetMaxMode returns the highest modus for the current driver. None. Return maximal X coordinate GetMaxX returns the maximum horizontal screen length None. Return maximal Y coordinate GetMaxY returns the maximum number of screen lines None. Return description a modus GetModeName Returns a string with the name of modus Modus None. Return lowest and highest modus of current driver GetModeRange returns the Lowest and Highest modus of the currently installed driver. If no modes are supported for this driver, HiModus will be -1. None. Return current palette GetPalette returns in Palette the current palette. None. Return maximal number of entries in current palette GetPaletteSize returns the maximum number of entries in the current palette. None. , Return color of pixel GetPixel returns the color of the point at (X,Y) None. Return current text style GetTextSettings returns the current text style settings : The font, direction, size and placement as set with SetTextStyle and SetTextJustify None. Return current viewport GetViewSettings returns the current viewport and clipping settings in ViewPort. None. Return current cursor X position GetX returns the X-coordinate of the current position of the graphical pointer None. Return current cursor Y position GetY returns the Y-coordinate of the current position of the graphical pointer None. Reset graphical mode to defaults GraphDefaults resets all settings for viewport, palette, foreground and background pattern, line-style and pattern, filling style, filling color and pattern, font, text-placement and text size. None. , Return a description of an error GraphErrorMsg returns a string describing the error Errorcode. This string can be used to let the user know what went wrong. None. Result of last graphical operation

GraphResult returns an error-code for the last graphical operation. If the returned value is zero, all went well. A value different from zero means an error has occurred. besides all operations which draw something on the screen, the following procedures also can produce a GraphResult different from zero:

None.
Return size to store image ImageSize returns the number of bytes needed to store the image in the rectangle defined by (X1,Y1) and (X2,Y2). None. Initialize grpahical system

InitGraph initializes the graph package. GraphDriver has two valid values: GraphDriver=0 which performs an auto detect and initializes the highest possible mode with the most colors. 1024x768x64K is the highest possible resolution supported by the driver, if you need a higher resolution, you must edit MODES.PPI. If you need another mode, then set GraphDriver to a value different from zero and graphmode to the mode you wish (VESA modes where 640x480x256 is 101h etc.). PathToDriver is only needed, if you use the BGI fonts from Borland. Free Pascal does not offer BGI fonts like Borland, these must be obtained separately.

Example code:

var gd,gm : integer; PathToDriver : string; begin gd:=detect; { highest possible resolution } gm:=0; { not needed, auto detection } PathToDriver:='C:\PP\BGI'; { path to BGI fonts, drivers aren't needed } InitGraph(gd,gm,PathToDriver); if GraphResult<>grok then halt; ..... { whatever you need } CloseGraph; { restores the old graphics mode } end.
None.
Install a user driver InstallUserDriver adds the device-driver DriverPath to the list of .BGI drivers. AutoDetectPtr is a pointer to a possible auto-detect function. None. Install a user-defined font InstallUserFont adds the font in FontPath to the list of fonts of the .BGI system. None. Draw a line between 2 points Line draws a line starting from (X1,Y1 to (X2,Y2), in the current line style and color. The current position is put to (X2,Y2) None. Draw a line starting from current position in given direction LineRel draws a line starting from the current pointer position to the point(DX,DY), relative to the current position, in the current line style and color. The Current Position is set to the endpoint of the line. None. Draw a line starting from current position to a given point LineTo draws a line starting from the current pointer position to the point(DX,DY), relative to the current position, in the current line style and color. The Current position is set to the end of the line. None. Move cursor relative to current position MoveRel moves the pointer to the point (DX,DY), relative to the current pointer position None. Move cursor to absolute position. MoveTo moves the pointer to the point (X,Y). None. Write text on the screen at the current location. OutText puts TextString on the screen, at the current pointer position, using the current font and text settings. The current position is moved to the end of the text. None. Write text on the screen on given position OutText puts TextString on the screen, at position (X,Y), using the current font and text settings. The current position is moved to the end of the text. None. Draw a pie-slice PieSlice draws and fills a sector of a circle with center (X,Y) and radius Radius, starting at angle Start and ending at angle Stop. None. Draw an in-memory image to the screen

PutImage Places the bitmap in Bitmap on the screen at (X1,Y1). How determines how the bitmap will be placed on the screen. Possible values are:

  • CopyPut
  • XORPut
  • ORPut
  • AndPut
  • NotPut
None
Draw a pixel on the screen Puts a point at (X,Y) using color Color None. Draw a rectangle on the screen. Draws a rectangle with corners at (X1,Y1) and (X2,Y2), using the current color and style. None. Register a new BGI driver. Registers a user-defined BGI driver None. , Register a new BGI font Registers a user-defined BGI driver None. , Restore text screen

Restores the screen modus which was active before the graphical modus was started.

To get back to the graph mode you were last in, you can use SetGraphMode(GetGraphMode)

None.
Draw and fill a sector of an ellipse Sector draws and fills a sector of an ellipse with center (X,Y) and radii XRadius and YRadius, starting at angle Start and ending at angle Stop. None. Set active graphical page Sets Page as the active page for all graphical output. None. Specify a complete new palette Sets the current palette to Palette. Palette is an untyped variable, usually pointing to a record of type PaletteType None. Set aspect ration of the screen Sets the aspect ratio of the current screen to Xasp/Yasp. None Set background drawing color Sets the background color to Color. None. Set foreground drawing color Sets the foreground color to Color. None. Set drawing fill pattern SetFillPattern sets the current fill-pattern to FillPattern, and the filling color to Color The pattern is an 8x8 raster, corresponding to the 64 bits in FillPattern. None Set drawing fill style

SetFillStyle sets the filling pattern and color to one of the predefined filling patterns. Pattern can be one of the following predefined constants :

EmptyFill
Uses backgroundcolor.
SolidFill
Uses filling color
LineFill
Fills with horizontal lines.
ltSlashFill
Fills with lines from left-under to top-right.
SlashFill
Idem as previous, thick lines.
BkSlashFill
Fills with thick lines from left-Top to bottom-right.
LtBkSlashFill
Idem as previous, normal lines.
HatchFill
Fills with a hatch-like pattern.
XHatchFill
Fills with a hatch pattern, rotated 45 degrees.
InterLeaveFill
WideDotFill
Fills with dots, wide spacing.
CloseDotFill
Fills with dots, narrow spacing.
UserFill
Fills with a user-defined pattern.
None.
Set the graphical buffer size (do not use) SetGraphBufSize is a dummy function which does not do anything; it is no longer needed. None. Set graphical mode SetGraphMode sets the graphical mode and clears the screen. None. Set line drawing style

SetLineStyle sets the drawing style for lines. You can specify a LineStyle which is one of the following pre-defined constants:

Solidln
draws a solid line.
Dottedln
Draws a dotted line.
Centerln
draws a non-broken centered line.
Dashedln
draws a dashed line.
UserBitln
Draws a User-defined bit pattern.

If UserBitln is specified then Pattern contains the bit pattern. In all another cases, Pattern is ignored. The parameter Width indicates how thick the line should be. You can specify one of the following pre-defined constants:

NormWidth
Normal line width
ThickWidth
Double line width
None.
Set palette entry using color constant SetPalette changes the ColorNr-th entry in the palette to NewColor None. Set palette entry using RGB value SetRGBPalette sets the ColorNr-th entry in the palette to the color with RGB-values Red, Green Blue. None. , Set text placement style

SetTextJustify controls the placement of new text, relative to the (graphical) cursor position. Horizontal controls horizontal placement, and can be one of the following pre-defined constants:

LeftText
Text is set left of the pointer.
CenterText
Text is set centered horizontally on the pointer.
RightText
Text is set to the right of the pointer.

Vertical controls the vertical placement of the text, relative to the (graphical) cursor position. Its value can be one of the following pre-defined constants :

BottomText
Text is placed under the pointer.
CenterText
Text is placed centered vertically on the pointer.
TopText
Text is placed above the pointer.
None.
Set text style

SetTextStyle controls the style of text to be put on the screen. pre-defined constants for Font are:

DefaultFont
The default font
TriplexFont
A special font
SmallFont
A smaller font
SansSerifFont
A sans-serif font (like Arial)
GothicFont
A gothic font
ScriptFont
A script font
SimpleFont
A simple font
TSCRFont
Terminal screen font
LCOMFont
?
EuroFont
?
BoldFont
A bold typeface font

Pre-defined constants for Direction are :

HorizDir
Write horizontal
VertDir
Write vertical
None.
Set user character size for vector font Sets the width and height of vector-fonts. The horizontal size is given by Xasp1/Xasp2, and the vertical size by Yasp1/Yasp2. None. Set the graphical drawing window Sets the current graphical viewport (window) to the rectangle defined by the top-left corner (X1,Y1) and the bottom-right corner (X2,Y2). If Clip is true, anything drawn outside the viewport (window) will be clipped (i.e. not drawn). Coordinates specified after this call are relative to the top-left corner of the viewport. None. Set video page which is displayed. SetVisualPage sets the video page to page number Page. None Specify binary operation to perform when drawing on screen

SetWriteMode controls the drawing of lines on the screen. It controls the binary operation used when drawing lines on the screen. Mode can be one of the following pre-defined constants:

CopyPut
Draw as specified using current bitmask and color
XORPut
Draw XOR-ing current bitmask and color
None.
Return height (in pixels) of the given string TextHeight returns the height (in pixels) of the string S in the current font and text-size. None. Return width (in pixels) of the given string TextHeight returns the width (in pixels) of the string S in the current font and text-size. None. Type redefinition Record describing resolution Horizontal resolution Vertical resolution Maximum value for smallint type Graphical operation went OK. Error: Graphical system not initialized Error: Graphics device not detected. Error: File for driver not found. Error: Invalid driver specified Error: Memory error. Error: Could not allocate memory for scan Error: Could not allocate memory for flood operation. Error: font description file not found. Error: Not enough memory to load font. Error: Invalid mode specified. Error: Unknown error. Error: Unspecified Input/Output error. Error: Invalid font description Error: Invalid font number Error: Invalid version. Color code: black. Color code: blue Color code: green Color code: Cyan Color code: Red Color code: Magenta Color code: brown Color code: Light gray Color code: Dark gray Color code: Light blue Color code: Light green Color code: Light cyan Color code: Light red Color code: Light magenta Color code: Yellow Color code: White Color code: EGA Black Color code: EGA blue Color code: EGA green Color code: EGA cyan Color code: EGA red Color code: EGA magenta Color code: EGA Light gray Color code: EGA brown Color code: EGA dark gray Color code: EGA Light blue Color code: EGA Light green Color code: EGA Light cyan Color code: EGA light red Color code: EGA light magenta Color code: EGA yellow Color code: EGA white Line style: Solid line Line style: Dotted line Line style: centered line Line style: dashed line Line style: User defined Line width: Normal width Line width: double width Font number: Normal font Font number: Triplex font Font number: Small font Font number: Sans Serif font Font number: Gothic font Font number: Script font Font number: Simple font Font number: Terminal font Font number: ? Font number: ? Font number: Bold font. Text write direction: Horizontal Text write direction: Vertical User character size Viewport clipping on Viewport clipping off Top on Top off Fill style: Do not fill Fill style: Solid fill. Fill style: Fill using horizontal lines Fill style: Light diagonal (slash) lines Fill style: Diagonal (slash) lines Fill style: Diagonal (backslash) lines Fill style: Light diagonal (backslash) lines Fill style: Hatch lines Fill style: Heavy hatch lines Fill style: Interleaving lines Fill style: Widely spaced dotted lines Fill style: Closely spaced dotted lines Fill style: User-defined fill. Draw operation: Use Normal (copy) operation Draw operation: use Copy Draw operation: use XOR Draw operation: use OR Draw operation: use AND Draw operation: use NOT Horizontal text alignment: Align text left Horizontal text alignment: Center text Horizontal text alignment: Align text right Vertical text alignment: Align text to bottom Vertical text alignment: Align text to top Currently used driver Mode: Detect mode. Mode: Low resolution. Mode: Hercules, mono color Mode: VGA graphics adaptor. Mode: VESA graphics adaptor. Mode: Depth 1 bit Mode: Depth 2 bit Mode: Depth 4 bit Mode: Depth 6 bit Mode: Depth 8 bit Mode: Depth 12 bit Mode: Depth 15 bit Mode: Depth 16 bit Mode: Depth 24 bit Mode: Depth 32 bit Mode: Depth 64 bit Mode: lowest number for new driver Mode: highest number for new driver Default mode Mode: VGA low resolution (640x200) Mode: VGA medium resolution (640x350) Mode: VGA high resolution (640x480) Mode: Autodetect optimal mode Mode: Resolution 320x200 Mode: Resolution 320x256 Mode: Resolution 320x400 Mode: Resolution 512x384 Mode: Resolution 640x200 Mode: Resolution 640x256 Mode: Resolution 640x350 Mode: Resolution 640x400 Mode: Resolution 640x480 Mode: Resolution 800x600 Mode: Resolution 832x624 Mode: Resolution 1024x768 Mode: Resolution 1280x1024 Mode: Resolution 1600x1200 Mode: Resolution 2048x1536 Mode: Lowest possible value of the new modes. Mode: Highest possible value of the new modes. Array with actual resolutions of the new modes Mode: Hercules card, monochrome, high resolution Max amount of colors in a palette Thickness of the drawn lines. The platform's preferred floating point size for fast graph operations Table with standard fill patterns Standard pixel drawing routine prototype. This is the standard putpixel routine used by all function drawing routines, it will use the viewport settings, as well as clip, and use the current foreground color to plot the desired pixel. Standard pixel fetching routine prototype Standard pixel drawing routine prototype Standard clearviewport routine prototype Standard procedure prototype. Standard procedure prototype. Standard calculation procedure prototype. Procedure prototype, used when heap memory is freed by the graph routines. Procedure prototype, used when heap memory is needed by the graph routines. Standard procedure prototype to draw a single horizontal line Standard procedure prototype to draw a single vertical line Standard procedure prototype to draw a patterned line Standard ellipse drawing routine prototype. Standard line drawing routine prototype. Standard getscanline routine prototype This routine is used for It returns an entire screen scan line with a word for each pixel in the scanline. Also handy for GetImage. Standard procedure prototype. Standard procedure prototype. Standard routine prototype to initialize a mode. Standard routine prototype to save the graphical state before a mode is set. Standard routine prototype to restore the graphical state at a closegraph call. This routine prototype is a hook for This routine prototype is a hook for This routine prototype is a hook for This routine prototype is a hook for Standard circle drawing routine prototype. Pointer to record Record describing a graphical mode. Number of the driver to be used in . Number of the mode to be used in . Internal mode number. Do not use. Max. number of colors in this mode. Max number of palette entries in this mode. X aspect (Aspect ratio correction factor) of mode Y aspect (Aspect ratio correction factor) of mode Max number of pixels in horizontal direction (columns). Max number of pixels in vertical direction (rows). Direct color mode ? (If False, uses palette) Total number of image pages - 1 Mode description. Mode Putpixel routine. Mode Getpixel routine. Mode Putpixel routine. Mode SetRGBPalette routine Mode GetRGBPalette routine Mode SetAllPalette routine Mode SetVisualPage routine Mode SetActivePage routine Mode Clearviewport routine. Mode PutImage routine. Mode GetImage routine. Mode ImageSize routine. Mode GetScanLine routine Mode Line drawing routine Mode ellipse drawing routine. Mode PatternLine routine. Mode Horizontal full line drawing routine. Mode vertical full line drawing routine. Mode circle drawing routine. Mode initialization routine. Mode OutTextXY routine. Pointer to next mode in linked list. Mode information for new modes.a Mode information pointers. Array of low and high bounds for modes. Hook to directly draw a pixel on the screen. Hook to set a RGB palette entries. Hook to free heap memory. Hook to get heap memory Hook to get a scan line from the screen. Hook to draw an ellipse Hook to draw a patterned line Hook to draw a solid horizontal line Hook to draw a solid vertical line Hook to save the current video state Hook to restore a saved video mode Character transliteration table, with entries for 256 characters Pointer to array. Default ansi transliteration table. Table used when transliterating strings. Should the background of texts be drawn or should it be left untouched ? Function called to retrieve the current video adapter settings. Attempt to enter direct video mode. SetDirectVideo attempts to enter direct video mode. In that mode, everything is drawn straight in the video buffer. Determine whether direct video mode is active. Mode: Resulution 320x200, 16 colors Mode: Resolution x, colors Mode: Resolution x, colors Mode: Resolution x, colors Mode: Resolution 320x200, 256 colors Mode: Resolution 320x240, 256 colors Mode: Resolution 320x400, 256 colors Mode: Resolution 360x480, 256 colors Mode: Resolution 640x480, 2 colors Mode: Resolution 640x480, 256 colors Mode: Resolution 800x600, 256 colors Mode: Resolution 1024x768, 256 colors Mode: Resolution 1280x1024, 256 colors Mode: Resolution 320x200, 32K colors Mode: Resolution 320x200, 64K colors Mode: Resolution 320x200, 16M colors Mode: Resolution 640x480, 32K colors Mode: Resolution 640x480, 64K colors Mode: Resolution 640x480, 16M colors Mode: Resolution 800x600, 32K colors Mode: Resolution 800x600, 64K colors Mode: Resolution 800x600, 16M colors Mode: Resolution 1024x768, 32K colors Mode: Resolution 1024x768, 64K colors Mode: Resolution 1024x768, 16M colors Mode: Resolution 1280x1024, 32K colors Mode: Resolution 1280x1024, 64K colors Mode: Resolution 1280x1024, 16M colors Mode: Resolution 800x600, 16 colors Mode: Resolution 1024x768, 16 colors Mode: Resolution 1280x1024, 16 colors Mode: Resolution 720x348, 2 colors Mode: Resolution 320x200, 16M 32-bit colors Mode: Resolution 640x480, 16M 32-bit colors Mode: Resolution 800x600, 16M 32-bit colors Mode: Resolution 1024x758, 16M 32-bit colors Mode: Resolution 1280x1024, 16M 32-bit colors Mode: Resolution 1152x864, 16 colors Mode: Resolution 1152x864, 256 colors Mode: Resolution 1152x864, 32K colors Mode: Resolution 1152x864, 64K colors Mode: Resolution 1152x864, 16M colors Mode: Resolution 1152x864, 16M 32-bitcolors Mode: Resolution 1600x1200, 16 colors Mode: Resolution 1600x1200, 256 colors Mode: Resolution 1600x1200, 32K colors Mode: Resolution 1600x1200, 64K colors Mode: Resolution 1600x1200, 16M colors Mode: Resolution 1600x1200, 16M 32-bit colors Low byte High byte Graphic driver for CGA cards Graphic driver for MCGA cards Graphic driver for EGA cards Graphic driver for EGA 64 cards Graphic driver for EGA monochrome cards CGA Graphic driver mode C0 CGA Graphic driver mode C1 CGA Graphic driver mode C2 CGA Graphic driver mode C3 CGA Graphic driver Hi-res mode MCGA Graphic driver mode C0 MCGA Graphic driver mode C1 MCGA Graphic driver mode C2 MCGA Graphic driver mode C3 MCGA Graphic driver medium resolution mode MCGA Graphic driver high resolution mode EGA graphic driver low resolution mode EGA graphic driver high resolution mode EGA64 graphic driver low resolution mode EGA64 graphic driver high resolution mode EGAMono graphic driver high resolution mode SetBKColor callback prototype SetBkColorProc is the procedure prototype for the method handler in . The procedure gets passed the color code for the color to set as background color. GetBKColor callback prototype GetBkColorProc is the procedure prototype for the method handler in . The function should return the color code of the background color. Set background color (SetBkColor) callback Get background color (GetBkColor) callback