Back in the days of 16-bit
Borland created a nice little library to play with graphics modes on your computer. Every video card manufacturer was different, but before that, even, people still had things like CGA and EGA cards. (I had an HGC — a thing of beauty, really.)
Programming each required different code, of course, so if you wanted to ship a program that did graphical stuff you also had to ship “drivers” (plug-ins, really) that understood how to manipulate your video card.
(The same situation exists today, except now card manufacturers understand that they should provide a common interface to their stuff and make installation as painless as possible — as in, plug-n-play.)
Borland's solution for Turbo C / Pascal / Basic
was to provide the Borland Graphics Interface
, or BGI, which let you query and initialize a graphics mode and then do things like draw lines and circles and text and pictures on the display. The BGI worked by finding an appropriate bgi file: egavga.bgi, for example, and loading it all plug-in style.
The interface to this library, in C at least, was accessible with
The library was simplistic and not really suited for any serious graphics crunching (as in modern games), but at the time it was still very cool that a programmer had such easy access to doing basic graphics. A lot of games were, in fact, written using it. (Serious game writers usually skipped BGI for their proprietary systems.)
But the simplicity and ease-of-use has made it a classic
, and it still has people who like to play with it today. Alas, we live in a very different world than it was 20+ years ago, and the old BGI library is useless on modern hardware without some serious help. (DOSBox
Enter some fellows at the University of Chicago
who wanted to let their students play with the old “graphics.h
” library. They wrote a version of it that worked on Windows and compiled with MinGW and called it, predictably, something like “Windows BGI for MinGW”, or “WinBGIm”.
The best way to learn more about it is to play with it. It's actually kind of fun. Download my repo and give it a compile to see some pretty lines and colors. Then explore the documentation and play with it. http://www.cs.colorado.edu/~main/cs1300/doc/bgi/bgi.html
You can find example programs at http://www.programmingsimplified.com/c/graphics.h
— all written for the original
BGI but still perfectly valid under WinBGIm.
I've written things like BreakOut and SpaceWar clones with it, and a TMNT game, complete with a sprite editor, various DND-style dungeon crawlers, etc. So for me, at least, it is packed full of nostalgia.