Programming with GRAPHICS
Because each kind of computer has its own graphics device drivers, each
computer will have different ways of programming graphics. Because of
this, programs that include graphics normally require a significant
amount of work to port them from platform to platform.
You have two real options if you want graphics in your C program on
Athena. The simplest is "curses". The curses library lets you use
character graphics, and control where in your xterm the cursor lies.
It's not sophisticated, but it works for suitable applications. For
information on it, type
man curses
from your athena% prompt.
On linux workstations, the ncurses library provides the same
functionality as the curses library. The ncurses library is also
available on Sun workstations.
The most frequently used graphics libraries on Athena are the X
programming libraries. They require a certain amount of learning to
use, but the X libraries, and the "widget" sets available, created most
of the graphic software that you can see on athena. For further
information, look under the XWINDOWS or C menus for the item:
Where to get information on PROGRAMMING IN X
X programming is also introduced towards the end of the 1.00 course at
MIT.
Note that neither of these libraries will port directly to a PC or
Macintosh environment. Speak with your local software retailer, or ask
advice over network news, for suggestions on good PC or Macintosh
libraries.
There are a couple of other graphics libraries available on Athena.
However, they are not widely used even at MIT, are not very portable off
Athena, and there is very limited, if any, expertise on their use. If
there is a particular library to which you need access in order to port
an existing program, ask in olc and we'll let you know if it's even
available.
last updated: 6/12/95
|