I hereby announce Drawbox, a new, open-source cross-platform graphics
library for C++. It has been under quiet development, and circulating
in the world of school teachers, for some months. But today I want to
announce it widely as an open-source effort, and invite the programming
public to try it - and to get involved.
I am aware of other cross-platform graphics efforts, particularly
ClanLib. But I offer this one also, because it is comes with a very
particular design goal, namely, ABSOLUTE EASE OF USE for student
programmers. Drawbox was designed as I taught a high school AP
Computer Science course; several features are chosen to be particularly
helpful for classroom use. Teachers, students, the self-taught, and
amateur programmers whose careers are in other fields, will all find
its simplicity especially helpful. For example: only one line of
#include is required; the very first line of executable code may be a
drawing command, and it will be drawn!
These are the core design goals:
- as absolutely friction-free as possible. Absolutely minimal setup
before getting to the task; no information forced upon the beginner
that he doesn't need to deal with.
- system-independent interface. The same source can be compiled with
(very nearly) the same results on MacOS and Windows.
- object-oriented: there are classes Point and Rect (among others) to
handle spatial information. But a beginner who is not yet ready to
handle classes can also work without them.
- functions are heavily overloaded so that the programmer can present
the parameters in the form in which he has them at the moment, instead
of wasting effort converting them to match.
Features include all the standard graphics primitives, keyboard and
mouse input with good support for detecting modifiers, fine grained
timing control, and bitmapped image support (JPEG under Windows, PICT
under MacOS). Auxiliary classes are provided to help with simulations
such as motion with gravity. A GUI toolkit is in process, but not
ready for the public view. (Ask if you want to beta test it.)
Drawbox is available at http://www.sparklight.com/drawbox . The
download includes all sources needed to build the library for Macintosh
and for Windows, as well as a tutorial and a well commented Drawbox.h
header file. It comes with project files for CodeWarrior on both
platforms, and Visual C++ for Windows. Plenty of sample programs, from
10-liners to moderately complex examples, are included. If you intend
to use it in a dual-platform environment, download to a Mac first, it
will preserve the file type information.
I have spent my sweat, and need to turn my energy to other things, most
especially teaching. But here are some improvements waiting for anyone
who might be inspired:
1. Port to Linux
2. Port to MacOS X native, either Carbon or Aqua or both.
3. Create project files for some of the free PC compilers, such as
4. Add JPEG support for Mac (it is already there for Windows).
5. Add multi-window support. Right now Drawbox addresses only one
And I'm sure the you, the user community, will think of many others. I
am ready to actively support those who are ready to get involved. To
Have fun and enjoy it!