Who this tutorial is for
This tutorial covers many topics in VGA programming in the C programming language. Users of this tutorial should have a comprehensive understanding of C and should also have a familiarity with DOS and BIOS function calls and interrupts.
A general knowledge of trigonometry and/or geometry would be helpful in the second section, Primitive Shapes & Lines
As with any sort of programming, an understanding of the hexadecimal number system would be helpful.
Materials needed
All the code in this tutorial was complied using Borland C/C++ 3.1 and DJGPP 2.0. The code was made to be as portable as possible, sticking close to the ANSI C standard, except for the DOS function calls and direct memory access. The programs should compile without a problem with the DOS 16-bit compilers Microsoft C (not Visual C++), Turbo C, and Borland C. For other compilers, see the Troubleshooting page.
The programs require DOS running on a 286 or better computer with a VGA or better video card. You can emulate this environment on almost any type of hardware by using the DOSBox emualtor.
Document Syntax
Text in monospace type
is a program, a program
segment, a DOS file name, or refers to a variable in a program or
program segment.
Text in italics is a variable, usually in a formula.
Hexadecimal numbers will have an “0x” prepended to them, like 0x3CF.