home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- /*
- * texback -
- * make a two colored textured background.
- *
- * Paul Haeberli - 1984
- *
- * Modified by Thant Tessman, then Gavin Bell to do stereo, 1990
- */
- #include <stdio.h>
- #include <string.h>
-
- #include "stereo.h"
-
-
- #define SEP 0
-
- /*
- * Local function prototypes
- */
- void background();
- void draw_pattern();
-
- main(argc,argv)
- int argc;
- char **argv;
- {
- int dev;
- short val;
-
- prefposition(0, getgdesc(GD_XPMAX), 0, getgdesc(GD_YPMAX));
-
- { /* Open window with name of executable */
- char *t;
- winopen((t=strrchr(argv[0], '/')) != NULL ? t+1 : argv[0]);
- }
-
- stereo_on(STR_RECT); /* From libstereo.a */
-
- qdevice(ESCKEY); /* Need to turn off stereo on quit */
- qdevice(WINQUIT); /* Need to turn off stereo on quit */
- qdevice(LEFTMOUSE); /* Eat up mouse events */
- qdevice(MIDDLEMOUSE); /* Eat up mouse events */
-
- background();
- while (dev = qread(&val))
- {
- switch(dev)
- {
- case REDRAW:
- background();
- break;
- case ESCKEY:
- case WINQUIT:
- stereo_off(); /* From libstereo.a */
- exit(0);
- }
- }
- }
-
- void
- background()
- {
- color(9);
- clear();
-
- color(10);
- draw_pattern();
- }
-
- void
- draw_pattern()
- {
- int i, j;
-
- color(BLACK);
- rectfi(0, YMAXSTEREO, XMAXSCREEN, YOFFSET);
-
- for (i=0; i<=XMAXSCREEN; i+=40)
- {
- move2i(i-SEP, 0);
- draw2i(i-SEP, YMAXSTEREO);
-
- move2i(i+SEP, 0+YOFFSET);
- draw2i(i+SEP, YMAXSTEREO+YOFFSET);
- }
-
- for (j=0; j<=YMAXSTEREO; j+=20)
- {
- move2i(0, j);
- draw2i(XMAXSCREEN, j);
-
- move2i(0, j+YOFFSET);
- draw2i(XMAXSCREEN, j+YOFFSET);
- }
- }
-