/* text.c:
A text drawing sample program using the charstr() subro utine. */
#include <gl/gl.h> #include <gl/device.h>
main() { Device dev; short val; initialize(); while (TRUE) { if (qtest()) { dev = qread(&val); if (dev == ESCKEY) { gexit(); exit(); } else if (dev == REDRAW) { reshapeviewport(); drawtext(); } } }
}
initialize() { int gid;
prefposition(XMAXSCREEN/4, XMAXSCREEN*3/4, YMAXSCREEN/4, YMAXSCREEN*3/4); gid = winopen("text"); winconstraints(); qdevice(ESCKEY); qdevice(REDRAW); qenter(REDRAW,gid); }
drawtext() {
color(BLACK); clear(); color(RED); cmov2i(300,380); charstr("The first line is drawn "); charstr("in two parts. "); cmov2i(300, 368); charstr("This line is 12 pixels lower. ");
}
The curson or cursoff subroutine.