home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / demos / audio / synthia / dsp_misc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  2.6 KB  |  127 lines

  1. /*
  2.  * Copyright 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. /*
  18.  * Copyright (C) 1991, Silicon Graphics, Inc.
  19.  * All Rights Reserved.
  20.  */
  21.     /*
  22.      *  Miscellaneous graphics functions
  23.      *
  24.      *  Routines:
  25.      *    check_pick ()
  26.      *    def_curs ()
  27.      *
  28.      *  Jim Bennett
  29.      *  1991
  30.      */
  31.  
  32. #include <gl/gl.h>
  33. #include "globj.h"
  34.  
  35. #define    MAXNAMES    100
  36. static    short    pickbuf [MAXNAMES] = {0};
  37.  
  38.     /*
  39.      *  check_pick  -  Check if any of the active controls were picked
  40.      */
  41.  
  42. check_pick ()
  43.  
  44.     {
  45.     short    *pickptr;
  46.     int    cnt;
  47.     int    picked;
  48.  
  49.     pickptr = pickbuf;
  50.     picked = 0;
  51.  
  52. /* Set picksize to require direct hit    */
  53.  
  54.     picksize (1, 1);
  55.     pick (pickptr, MAXNAMES);
  56.     draw_scene (TRUE);
  57.     endpick (pickptr);
  58.  
  59. /* Scan through pick buffer, choose the last entry as the one    */
  60.  
  61.     cnt = *pickptr;
  62.     *pickptr++ = 0;
  63.     while (cnt != 0)
  64.         {
  65.         while (cnt-- > 0)
  66.             {
  67.             picked = *pickptr;
  68.             *pickptr++ = 0;
  69.             }
  70.         cnt = *pickptr;
  71.         *pickptr++ = 0;
  72.         }
  73.  
  74.     return (picked);
  75.     }
  76.  
  77.     /*
  78.      *  def_curs  -  Define all of the cursors needed by synthia
  79.      */
  80.  
  81. static    unsigned short    curs_busy_1 [2] [16] =
  82.     {
  83.         {
  84.         0xffff, 0xffff, 0xc003, 0x6006,
  85.         0x300c, 0x1818, 0x0c30, 0x0660,
  86.         0x0660, 0x0c30, 0x1818, 0x300c,
  87.         0x6006, 0xc003, 0xffff, 0xffff
  88.         },
  89.  
  90.         {
  91.         0x0000, 0x0000, 0x0ff0, 0x07c0,
  92.         0x0180, 0x0000, 0x0100, 0x0000,
  93.         0x0080, 0x0180, 0x03c0, 0x0380,
  94.         0x0000, 0x0000, 0x0000, 0x0000
  95.         }
  96.     };
  97.  
  98. static    unsigned short    curs_busy_2 [2] [16] =
  99.     {
  100.         {
  101.         0xffff, 0xffff, 0xcff3, 0x67c6,
  102.         0x318c, 0x1818, 0x0d30, 0x0660,
  103.         0x06e0, 0x0db0, 0x1bd8, 0x338c,
  104.         0x6006, 0xc003, 0xffff, 0xffff
  105.         },
  106.  
  107.         {
  108.         0x0000, 0x0000, 0x0ff0, 0x07c0,
  109.         0x0180, 0x0000, 0x0100, 0x0000,
  110.         0x0080, 0x0180, 0x03c0, 0x0380,
  111.         0x0000, 0x0000, 0x0000, 0x0000
  112.         }
  113.     };
  114.  
  115. def_curs ()
  116.  
  117.     {
  118.     curstype (C16X2);
  119.     defcursor (BUSY_BEE_1, &curs_busy_1[0][0]);
  120.     defcursor (BUSY_BEE_2, &curs_busy_2[0][0]);
  121.     drawmode (CURSORDRAW);
  122.     mapcolor (1, 224,  64,  64);
  123.     mapcolor (2, WHITE_KEY_TOP);
  124.     mapcolor (3, BLACK_KEY_TOP);
  125.     drawmode (NORMALDRAW);
  126.     }
  127.