David Brackeen has a very good tutorial on VGA graphics programming for DOS in C programming. The tutorial is a five part C programming tutorial which covers VGA basics, Primitive Shapes & Lines, Bitmaps & Palette Manipulation, Mouse Support & Animation and Double Buffering, Page Flipping, & Unchained Mode. This tutorial covers many topics in VGA programming in the C programming language. Tutorial assumes that the programmers have a comprehensive understanding of C and should also have a familiarity with DOS and BIOS function calls and interrupts. Knowledge of trigonometry and geometry would also be helpful.

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 emulator.

The tutorial also have a good selection of links and other resources for compilers and other related sites. Also there is a complete list of downloadable source code, makefiles, executables, and bitmaps. FAQ section answers most commonly asked questions about compilers, source code and VGS programming problems.

You can find the complete tutorial here. http://www.brackeen.com/vga/

Download the source code here: http://www.brackeen.com/vga/download.html